-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (24 loc) · 1.21 KB
/
Copy pathmain.py
File metadata and controls
31 lines (24 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from tradingagents.graph.trading_graph import TradingAgentsGraph
from tradingagents.default_config import DEFAULT_CONFIG
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
# Create a custom config
config = DEFAULT_CONFIG.copy()
config["deep_think_llm"] = "gpt-4o-mini" # Use a different model
config["quick_think_llm"] = "gpt-4o-mini" # Use a different model
config["max_debate_rounds"] = 3 # Increase debate rounds
# Configure data vendors to use AKShare (matching default_config.py)
config["data_vendors"] = {
"core_stock_apis": "akshare", # Options: yfinance, alpha_vantage, akshare, baostock, local
"technical_indicators": "akshare", # Options: yfinance, alpha_vantage, akshare, local
"fundamental_data": "akshare", # Options: openai, alpha_vantage, akshare, baostock, local
"news_data": "akshare", # Options: akshare, openai, alpha_vantage, google, local
}
# Initialize with custom config
ta = TradingAgentsGraph(debug=True, config=config)
# forward propagate
_, decision = ta.propagate("NVDA", "2024-05-10")
print(decision)
# Memorize mistakes and reflect
# ta.reflect_and_remember(1000) # parameter is the position returns