22 lines
830 B
Python
22 lines
830 B
Python
from tradingagents.graph.trading_graph import TradingAgentsGraph
|
|
from tradingagents.default_config import DEFAULT_CONFIG
|
|
|
|
# Create a custom config
|
|
config = DEFAULT_CONFIG.copy()
|
|
config["llm_provider"] = "openai" # Use a different model
|
|
config["backend_url"] = "https://api.openai.com/v1" # Use a different backend
|
|
config["deep_think_llm"] = "o4-mini" # Use a different model
|
|
config["quick_think_llm"] = "gpt-4o-mini" # Use a different model
|
|
config["max_debate_rounds"] = 1 # Increase debate rounds
|
|
config["online_tools"] = True # Increase debate rounds
|
|
|
|
# Initialize with custom config
|
|
ta = TradingAgentsGraph(debug=True, config=config)
|
|
|
|
# forward propagate
|
|
_, decision = ta.propagate("NVDA", "2024-08-01")
|
|
print(decision)
|
|
|
|
# Memorize mistakes and reflect
|
|
# ta.reflect_and_remember(1000) # parameter is the position returns
|