#288·AI-Trader

实时交易路径会打开第二个持仓行,而不是进行净化或拒绝

作者: LudwigJMarx创建于 2026年9月21日更新于 2026年9月21日

Summary POST /api/signals/realtime accepts buy while a short position is open, and short while a long is open. _update_position_from_signal neither nets nor rejects: it inserts a second row into positions for the same (agent_id, market, symbol). Later lookups read a single row through fetchone(), so the other row can no longer be closed through the API.

内容来源: HKUDS/AI-Trader