Update docs for CTP worker split and roll breakout off-session.
Refresh DEPLOY, TRADING, STRATEGY, CTP_LIVE, FEATURES, INDEX, and README to document qihuo-ctp architecture, dual PM2 restarts, and休盘突破加仓. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+17
-2
@@ -2,7 +2,22 @@
|
||||
|
||||
本文说明如何接入 **期货公司实盘 CTP**,并对比 **SimNow 模拟盘** 与 **实盘** 的开平仓逻辑是否一致。
|
||||
|
||||
相关代码:`vnpy_bridge.py`、`ctp_settings.py`、`trading_context.py`、`install_trading.py`。
|
||||
相关代码:`vnpy_bridge.py`、`ctp_worker.py`、`ctp_ipc_client.py`、`ctp_settings.py`、`trading_context.py`、`install_trading.py`。
|
||||
|
||||
---
|
||||
|
||||
## 进程架构(Web / CTP Worker)
|
||||
|
||||
自 2026-03 起,CTP 与 vn.py **不在 Flask 进程内**运行:
|
||||
|
||||
| 组件 | PM2 名 | 说明 |
|
||||
|------|--------|------|
|
||||
| Web | `qihuo` | 页面与 API;`QIHUO_CTP_ROLE=client`,经 `127.0.0.1:6601` IPC 访问 Worker |
|
||||
| CTP Worker | `qihuo-ctp` | 唯一加载 vnpy_ctp;连接、报单、持仓回调、止盈止损、滚仓 pending 监控 |
|
||||
|
||||
SimNow 与期货公司实盘的 **报单代码路径不变**,仍走 `execute_order()` → `vnpy_bridge.send_order()`;Web 侧为 IPC 代理,Worker 侧为原生调用。
|
||||
|
||||
部署与重启见 [DEPLOY.md](./DEPLOY.md)。
|
||||
|
||||
---
|
||||
|
||||
@@ -76,7 +91,7 @@ CTP_LIVE_ENV=实盘
|
||||
3. **下单监控** → **连接 CTP**
|
||||
4. 顶栏显示 **CTP 已连接**、**期货公司实盘**,权益为柜台资金
|
||||
|
||||
修改模式或前置后建议 **重连 CTP** 或 `pm2 restart qihuo`。
|
||||
修改模式或前置后建议 **重连 CTP** 或 `pm2 restart ecosystem.config.cjs --update-env`(同时重启 Web 与 Worker)。
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user