完善下单表单与 CTP 持仓,requirements 加入 vnpy 并更新部署文档

以损定仓/固定张数分栏下单、限价市价、持仓仅读柜台;DEPLOY 补充 SimNow 与 vnpy 安装说明。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-24 10:52:25 +08:00
parent 709801305f
commit 62cd868f79
9 changed files with 394 additions and 308 deletions
+20 -6
View File
@@ -9,14 +9,27 @@
已移除「本地 SQLite 假撮合」;模拟盘与实盘均走 **vnpy_ctp**,仅 `.env` 前置与账号不同。
## 依赖安装
`requirements.txt` 已包含 `vnpy``vnpy_ctp`。服务器部署:
```bash
cd /opt/qihuo
source venv/bin/activate
pip install -r requirements.txt
python -c "from vnpy_ctp import CtpGateway; print('OK')"
```
详见 [DEPLOY.md](./DEPLOY.md) 中「CTP / vnpy 故障排查」。
## 首次使用 SimNow
1. 在 [SimNow](https://www.simnow.com.cn/) 注册仿真账号
2. 复制 `.env.example``.env`,填写 `SIMNOW_USER``SIMNOW_PASSWORD`
3. 核对 SimNow 官网最新的 **7×24 或交易时段** 前置地址
4. `pip install vnpy vnpy_ctp`
5. 启动程序 → **期货下单** → 点击 **连接 CTP**
6. 连接成功后,权益、持仓、下单均来自 SimNow
4. `pip install -r requirements.txt`(含 vnpyvnpy_ctp
5. 启动程序 → **持仓监控** → 点击 **连接 CTP**
6. 连接成功后,权益、持仓、下单均来自 SimNow 柜台
## 参考资金
@@ -26,8 +39,7 @@
| 页面 | 路径 |
|------|------|
| 品种推荐 | `/recommend` |
| 期货下单 | `/trade` |
| 持仓监控(含下单、推荐 | `/positions` |
| 策略交易 | `/strategy` |
| 策略记录 | `/strategy/records` |
@@ -37,4 +49,6 @@
|------|------|
| `POST /api/ctp/connect` | 按当前模式连接 SimNow 或实盘 CTP |
| `GET /api/ctp/status` | 连接状态与缺失配置项 |
| `POST /api/trade/order` | 限价报单(需已连接 CTP |
| `POST /api/trade/order` | 报单(限价/市价,需已连接 CTP |
| `GET /api/trading/live` | 持仓(CTP 柜台数据) |
| `GET /api/recommend/stream` | 品种推荐 SSE 推送 |