fix fear and greed and market analyst symbol

This commit is contained in:
mhmmdjafarg 2025-12-26 09:07:54 +07:00
parent 823627c6a4
commit 1732b54e0c
6 changed files with 16 additions and 11 deletions

View File

@ -432,7 +432,7 @@ def get_user_selections():
# Step 1: Ticker symbol
console.print(
create_question_box(
"Step 1: Ticker Symbol", "Enter the ticker symbol to analyze", "SPY"
"Step 1: Ticker Symbol", "Enter the ticker symbol to analyze", "BTC/USDT"
)
)
selected_ticker = get_ticker()
@ -498,7 +498,7 @@ def get_user_selections():
def get_ticker():
"""Get ticker symbol from user input."""
return typer.prompt("", default="SPY")
return typer.prompt("", default="BTC/USDT")
def get_analysis_date():

View File

@ -5,14 +5,14 @@ from tradingagents.dataflows.interface import route_to_vendor
@tool
def get_fundamentals(
ticker: Annotated[str, "ticker symbol"],
ticker: Annotated[str, "ticker symbol"], # e.g., 'BTC/USDT'
curr_date: Annotated[str, "current date you are trading at, yyyy-mm-dd"],
) -> str:
"""
Retrieve comprehensive fundamental data for a given ticker symbol.
Uses the configured fundamental_data vendor.
Args:
ticker (str): Ticker symbol of the company
ticker (str): Ticker symbol of the cryptocurrency
curr_date (str): Current date you are trading at, yyyy-mm-dd
Returns:
str: A formatted report containing comprehensive fundamental data
@ -98,4 +98,4 @@ def get_market_cap() -> str:
Returns:
str: A formatted string containing market capitalization percentages
"""
return route_to_vendor("get_market_cap")
return route_to_vendor("get_market_cap")

View File

@ -28,16 +28,16 @@ def get_market_data(symbol: str, start_date: str, end_date: str):
CSV formatted string with OHLCV data
"""
# remove / from symbol for binance format
symbol = symbol.replace("/", "")
formatted_symbol = symbol.replace("/", "")
# Convert dates to epoch time (milliseconds)
start_epoch = int(datetime.strptime(start_date, "%Y-%m-%d").timestamp() * 1000)
end_epoch = int(datetime.strptime(end_date, "%Y-%m-%d").timestamp() * 1000)
print(f"DEBUG: Fetching data for {symbol} from {start_date} to {end_date}")
print(f"DEBUG: Fetching data for {formatted_symbol} from {start_date} to {end_date}")
try:
response = client.rest_api.klines(
symbol=symbol,
symbol=formatted_symbol,
start_time=start_epoch,
end_time=end_epoch,
interval="1d",

View File

@ -149,7 +149,10 @@ def get_crypto_stats_indicators(
Returns:
str: A formatted report containing all requested technical indicators for the specified ticker symbol.
"""
# validate symbol it must in format BASE/QUOTE
if "/" not in symbol:
return f"Error: Symbol '{symbol}' is not in the correct format. Please use 'BASE/QUOTE' format, e.g., 'BTC/USDT'."
# Supported indicators mapping
supported_indicators = {
"sma": "Simple Moving Average",

View File

@ -24,7 +24,7 @@ DEFAULT_CONFIG = {
"core_stock_apis": "yfinance", # Options: yfinance, alpha_vantage, local
"technical_indicators": "taapi", # Options: taapi
"fundamental_data": "alpha_vantage", # Options: openai, alpha_vantage, local
"news_data": "alpha_vantage", # Options: openai, alpha_vantage, google, local
"news_data": "telegram", # Options: openai, alpha_vantage, google, local
},
# Tool-level configuration (takes precedence over category-level)
"tool_vendors": {

View File

@ -37,7 +37,8 @@ from tradingagents.agents.utils.agent_utils import (
get_news,
get_insider_sentiment,
get_insider_transactions,
get_global_news
get_global_news,
get_fear_and_greed
)
from .conditional_logic import ConditionalLogic
@ -142,6 +143,7 @@ class TradingAgentsGraph:
[
# News tools for social media analysis
get_news,
get_fear_and_greed,
]
),
"news": ToolNode(