From 48ef90741ff44bbd0462dd801307a74ac41b412a Mon Sep 17 00:00:00 2001 From: 69049ed6x <69049ed6x@users.noreply.github.com> Date: Sun, 8 Mar 2026 14:33:52 +0800 Subject: [PATCH] docs: merge factor rules usage example --- README.md | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 73ded398..37a7a6ac 100644 --- a/README.md +++ b/README.md @@ -208,17 +208,7 @@ Example rule file format: } ``` -Example config: - -```python -config = DEFAULT_CONFIG.copy() -config["factor_rules_path"] = "./tradingagents/examples/factor_rules.json" -ta = TradingAgentsGraph( - debug=True, - config=config, - selected_analysts=["market", "social", "news", "fundamentals", "factor_rules"], -) -``` +Example config and usage: ```python from tradingagents.graph.trading_graph import TradingAgentsGraph @@ -229,8 +219,13 @@ config["llm_provider"] = "openai" # openai, google, anthropic, xai, openr config["deep_think_llm"] = "gpt-5.2" # Model for complex reasoning config["quick_think_llm"] = "gpt-5-mini" # Model for quick tasks config["max_debate_rounds"] = 2 +config["factor_rules_path"] = "./tradingagents/examples/factor_rules.json" -ta = TradingAgentsGraph(debug=True, config=config) +ta = TradingAgentsGraph( + debug=True, + config=config, + selected_analysts=["market", "social", "news", "fundamentals", "factor_rules"], +) _, decision = ta.propagate("NVDA", "2026-01-15") print(decision) ```