Deprecate kimi backup dir; drop sync requirement (now under git)

This commit is contained in:
Tommy 2026-08-11 19:43:55 -04:00
parent 9d8ac45da0
commit 427ea00b71
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ Interactive Brokers 股票自动交易机器人Python + ib_insync多策
- **外部成交价 0.0 必须按"未知"处理**`reqCompletedOrders` 对跨会话(上次 bot 会话)的已完成订单可能返回 `avgFillPrice=0.0`。`main.py` 的 `_completed_stp_fills` 要跳过 `fill_price <= 0` 的订单;`state.py` 的 `_record_external_sell``estimated = not price`None 或 0.0 都视为取不到)→ 按止损价 -2% 估记并标 `est:true`。否则会把 0.0 当真价写账本亏损虚算07-31 修复:迁移目录时踩中,造成 day_pnl 虚增 -1668.74)。
- **僵尸 STPPreSubmitted 永不变更)+ `has_open_order` 造成"假卡死"**:被风控拒掉/IB 端失同步的 STP 会以 PreSubmitted 卡在 `ib.openTrades()`isDone()=False`has_open_order` 永远返回 True → `_place_stop` 静默 skip`_raise_stop_if_needed` 只在 target>current 时撤单重挂,价格不符的僵尸单永不处理 → bot 看起来"卡死"(无日志,持仓无有效 STP。症状`reqAllOpenOrdersAsync`(跨 clientId可见这些单`cancelOrder` 报 Error 10147 取不掉。恢复:`reqGlobalCancel()` 清掉全部僵尸单后重启。防御08-03 修复):`_raise_stop_if_needed` 改为 **auxPrice 与目标价不匹配(容差 <0.01)就撤单重挂**,不只处理上移。另:`has_open_order` 只看 `openTrades()`(本 clientId 自己的单),`reqOpenOrdersAsync` 返回本 clientId 的订单,诊断全账户订单要用 `reqAllOpenOrdersAsync`
- **Cancelled STP 必须当轮重挂**`_sync_stop_orders` 消费终态订单后若 owned 且未成交,**同一周期**就 `_place_stop`,不要拖到下轮(旧代码 `continue` 后依赖下一轮 by_ref 找不到已 consumed 的单才重挂,重启后首轮只挂 1 条就停。08-03 修复。
- **正式目录是 `~/Desktop/DeepSeek/BotDeepSeek`**bot 自此从该目录启动(`restart_bot.sh` 自定位)。`~/Desktop/kimi/ib-trading-bot-kimi` 仅作备份保留,勿再从那里启动;两目录代码保持一致
- **正式目录是 `~/Desktop/DeepSeek/BotDeepSeek`**bot 自此从该目录启动(`restart_bot.sh` 自定位)。`~/Desktop/kimi/ib-trading-bot-kimi` 已于 2026-08-11 废弃git 仓库已建立,无需再同步备份目录;目录将删除)
## 环境特殊性

View File

@ -6,7 +6,7 @@
## 项目结构
```
ib-trading-bot-kimi/
BotDeepSeek/
├── config.py # 配置管理dataclass + .env 环境变量)
├── connection.py # TWS/IB Gateway 连接管理(含自动重连)
├── bars.py # 共享K线订阅管理keepUpToDate 增量推送)