fix: always run short horizon only (medium is redundant)#136
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Someone is attempting to deploy a commit to the mountaintop's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@yunchat 每个analyst之所以使用固定视角,是因为他们其实只适用短线分析。 比如这些market/social/news,长线不需要看主力,不需要看当前新闻,只看基本面等信息就差不多了了。量价分析可能要考虑一下允许中长期视角。 |
|
我同意dual horizon没有意义 |
Code reviewFound 2 issues:
TradingAgents-AShare/api/main.py Lines 1865 to 1867 in effc2c8
if not request.horizons:
request.horizons = ["short"]
elif len(request.horizons) > 1:
request.horizons = [request.horizons[0]]The PR's unconditional assignment would regress this by hardcoding TradingAgents-AShare/api/main.py Lines 1865 to 1867 in effc2c8 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…ylinMountain#136) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
medium 和 short 的区别只是 prompt 里的"视角描述",流程完全一样
每个 analyst 都硬编码了自己的 horizon,不受传入的 state["horizon"] 影响:
所以不管你传 horizons=["short"] 还是 ["short","medium"],每个 analyst 的行为完全一样。
跑2次的原因:
horizons=["short","medium"] 时,代码在 asyncio.gather 里并行跑两个完整的 graph:
results = await asyncio.gather(
*[_process_horizon(h) for h in request.horizons], # 跑2遍
)
每遍都是完整的 6个analysts + bull/bear + trader + 风控,两遍产出的内容几乎一模一样,最后只取 short 的结果,medium
的只保留 traces。
结论:
如果你想真正支持中线分析,需要让 fundamentals/macro analyst 根据传入的 horizon 动态调整数据窗口和
prompt,而不是硬编码。目前的实现 dual_horizon 没有实际意义。