fix fear and greed and market analyst symbol
This commit is contained in:
parent
823627c6a4
commit
1732b54e0c
|
|
@ -432,7 +432,7 @@ def get_user_selections():
|
||||||
# Step 1: Ticker symbol
|
# Step 1: Ticker symbol
|
||||||
console.print(
|
console.print(
|
||||||
create_question_box(
|
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()
|
selected_ticker = get_ticker()
|
||||||
|
|
@ -498,7 +498,7 @@ def get_user_selections():
|
||||||
|
|
||||||
def get_ticker():
|
def get_ticker():
|
||||||
"""Get ticker symbol from user input."""
|
"""Get ticker symbol from user input."""
|
||||||
return typer.prompt("", default="SPY")
|
return typer.prompt("", default="BTC/USDT")
|
||||||
|
|
||||||
|
|
||||||
def get_analysis_date():
|
def get_analysis_date():
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,14 @@ from tradingagents.dataflows.interface import route_to_vendor
|
||||||
|
|
||||||
@tool
|
@tool
|
||||||
def get_fundamentals(
|
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"],
|
curr_date: Annotated[str, "current date you are trading at, yyyy-mm-dd"],
|
||||||
) -> str:
|
) -> str:
|
||||||
"""
|
"""
|
||||||
Retrieve comprehensive fundamental data for a given ticker symbol.
|
Retrieve comprehensive fundamental data for a given ticker symbol.
|
||||||
Uses the configured fundamental_data vendor.
|
Uses the configured fundamental_data vendor.
|
||||||
Args:
|
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
|
curr_date (str): Current date you are trading at, yyyy-mm-dd
|
||||||
Returns:
|
Returns:
|
||||||
str: A formatted report containing comprehensive fundamental data
|
str: A formatted report containing comprehensive fundamental data
|
||||||
|
|
@ -98,4 +98,4 @@ def get_market_cap() -> str:
|
||||||
Returns:
|
Returns:
|
||||||
str: A formatted string containing market capitalization percentages
|
str: A formatted string containing market capitalization percentages
|
||||||
"""
|
"""
|
||||||
return route_to_vendor("get_market_cap")
|
return route_to_vendor("get_market_cap")
|
||||||
|
|
|
||||||
|
|
@ -28,16 +28,16 @@ def get_market_data(symbol: str, start_date: str, end_date: str):
|
||||||
CSV formatted string with OHLCV data
|
CSV formatted string with OHLCV data
|
||||||
"""
|
"""
|
||||||
# remove / from symbol for binance format
|
# remove / from symbol for binance format
|
||||||
symbol = symbol.replace("/", "")
|
formatted_symbol = symbol.replace("/", "")
|
||||||
|
|
||||||
# Convert dates to epoch time (milliseconds)
|
# Convert dates to epoch time (milliseconds)
|
||||||
start_epoch = int(datetime.strptime(start_date, "%Y-%m-%d").timestamp() * 1000)
|
start_epoch = int(datetime.strptime(start_date, "%Y-%m-%d").timestamp() * 1000)
|
||||||
end_epoch = int(datetime.strptime(end_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:
|
try:
|
||||||
response = client.rest_api.klines(
|
response = client.rest_api.klines(
|
||||||
symbol=symbol,
|
symbol=formatted_symbol,
|
||||||
start_time=start_epoch,
|
start_time=start_epoch,
|
||||||
end_time=end_epoch,
|
end_time=end_epoch,
|
||||||
interval="1d",
|
interval="1d",
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,10 @@ def get_crypto_stats_indicators(
|
||||||
Returns:
|
Returns:
|
||||||
str: A formatted report containing all requested technical indicators for the specified ticker symbol.
|
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 mapping
|
||||||
supported_indicators = {
|
supported_indicators = {
|
||||||
"sma": "Simple Moving Average",
|
"sma": "Simple Moving Average",
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ DEFAULT_CONFIG = {
|
||||||
"core_stock_apis": "yfinance", # Options: yfinance, alpha_vantage, local
|
"core_stock_apis": "yfinance", # Options: yfinance, alpha_vantage, local
|
||||||
"technical_indicators": "taapi", # Options: taapi
|
"technical_indicators": "taapi", # Options: taapi
|
||||||
"fundamental_data": "alpha_vantage", # Options: openai, alpha_vantage, local
|
"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-level configuration (takes precedence over category-level)
|
||||||
"tool_vendors": {
|
"tool_vendors": {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,8 @@ from tradingagents.agents.utils.agent_utils import (
|
||||||
get_news,
|
get_news,
|
||||||
get_insider_sentiment,
|
get_insider_sentiment,
|
||||||
get_insider_transactions,
|
get_insider_transactions,
|
||||||
get_global_news
|
get_global_news,
|
||||||
|
get_fear_and_greed
|
||||||
)
|
)
|
||||||
|
|
||||||
from .conditional_logic import ConditionalLogic
|
from .conditional_logic import ConditionalLogic
|
||||||
|
|
@ -142,6 +143,7 @@ class TradingAgentsGraph:
|
||||||
[
|
[
|
||||||
# News tools for social media analysis
|
# News tools for social media analysis
|
||||||
get_news,
|
get_news,
|
||||||
|
get_fear_and_greed,
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
"news": ToolNode(
|
"news": ToolNode(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue