refactor: 移除 gate_bot,统一为三所架构并更新文档

删除 crypto_monitor_gate_bot 目录,中控与子代理改为 binance/okx/gate 三账户;
文档与 UI 文案「四所」改为「三所」;新增清库前一次性配置备份脚本。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-04 22:00:08 +08:00
parent be51eee73f
commit 9f67de3677
138 changed files with 26395 additions and 40057 deletions
+9 -9
View File
@@ -1,6 +1,6 @@
# 策略交易说明
本文档说明仓库根目录 **共用策略逻辑**`crypto_monitor_*` 实例中的 **策略交易** 入口(顶栏「策略交易」,页内子 Tab:趋势回调 / 顺势加仓)。
本文档说明仓库根目录 **共用策略逻辑**`crypto_monitor_*` 实例中的 **策略交易** 入口(顶栏「策略交易」,页内子 Tab:趋势回调 / 顺势加仓)。
---
@@ -35,7 +35,7 @@ strategy_records_register.py # /strategy/records 路由与列表数据
| 区域 | 说明 |
|------|------|
| 左栏 · 趋势回调 | **所均可**(预览、执行、自动补仓、程序止盈);运行中计划卡含 **补仓计划明细** 表 |
| 左栏 · 趋势回调 | **所均可**(预览、执行、自动补仓、程序止盈);运行中计划卡含 **补仓计划明细** 表 |
| 右栏 · 顺势加仓 | 须已有同向持仓;滚仓组/历史表在右栏内滚动 |
| **策略交易记录** | 趋势回调 / 顺势加仓 **分两栏**;每条约一行摘要,点击展开详情;库内保留最近 **100** 条 |
| `/trade` | 实盘下单 | 首仓、以损定仓、移动保本(不变) |
@@ -44,14 +44,14 @@ strategy_records_register.py # /strategy/records 路由与列表数据
---
## 三、趋势回调(延续 Gate 趋势机器人逻辑)
## 三、趋势回调
- **位置**:各所顶栏 **策略交易 → 趋势回调**(共用 `strategy_trend_register.py` + 各所交易所 API)。
- **行为**:与《[crypto_monitor_gate_bot/趋势回调策略说明.md](./crypto_monitor_gate_bot/趋势回调策略说明.md)》一致——预览 → 确认执行 → 首仓 50% + 交易所止损 + 多档 **自动** 市价补仓 + 程序监控止盈。
- **行为**:与《[docs/trend-pullback-strategy.md](./docs/trend-pullback-strategy.md)》一致——预览 → 确认执行 → 首仓 50% + 交易所止损 + 多档 **自动** 市价补仓 + 程序监控止盈。
- **共用代码**`parse_and_compute_trend_pullback_plan` 中网格/拆档已改为调用 `strategy_trend_lib`
- **互斥**:与「机器人下单监控」持仓上限、运行中趋势计划互斥(逻辑未改)。
逻辑与 gate_bot 一致;各所使用自己的 API 密钥与 `crypto.db`,互不影响。
各所使用自己的 API 密钥与 `crypto.db`,互不影响。
---
@@ -98,7 +98,7 @@ strategy_records_register.py # /strategy/records 路由与列表数据
---
## 五、策略交易记录(所统一)
## 五、策略交易记录(所统一)
- **入口**:顶栏 **策略交易记录**`/strategy/records``strategy_records_register.register_strategy_records`)。
- **写入时机**:趋势计划结束(止盈 / 止损 / 手动结束)、**保本移交**、顺势加仓组结案时,写入表 **`strategy_trade_snapshots`**`strategy_snapshot_lib`)。
@@ -108,7 +108,7 @@ strategy_records_register.py # /strategy/records 路由与列表数据
- **左栏卡片**:趋势回调记录;**右栏卡片**:顺势加仓记录。
- 每条默认 **一行简略**(品种、方向、结果、盈亏、补仓进度、结束时间);**点击行**展开均价/止损/止盈/补仓档位表或滚仓腿表。
- **筛选**:币种、时间排序(最新/最早)、芯片 **盈利 / 亏损 / 未补仓 / 补仓**(前端过滤,数据来自服务端 enrich 字段 `filter_pnl``dca_tag``dca_done`)。
- **共用模板**`strategy_templates/strategy_records_page.html``index.html` include)。
- **共用模板**`strategy_templates/strategy_records_page.html``index.html` include)。
---
@@ -132,7 +132,7 @@ strategy_records_register.py # /strategy/records 路由与列表数据
```bash
cd /opt/crypto_monitor
git pull
pm2 restart crypto-monitor-binance crypto-monitor-okx crypto-monitor-gate crypto-monitor-gate-bot manual-trading-hub
pm2 restart crypto-monitor-binance crypto-monitor-okx crypto-monitor-gate manual-trading-hub
pm2 save
```
@@ -144,7 +144,7 @@ pm2 save
| 文档 | 内容 |
|------|------|
| [crypto_monitor_gate_bot/趋势回调策略说明.md](./crypto_monitor_gate_bot/趋势回调策略说明.md) | 趋势回调细则(与四所共用逻辑一致 |
| [docs/trend-pullback-strategy.md](./docs/trend-pullback-strategy.md) | 趋势回调细则(所共用逻辑) |
| [AI复盘与模型配置说明.md](./AI复盘与模型配置说明.md) | 复盘页 AI(与策略无关) |
| [manual_trading_hub/使用说明.md](./manual_trading_hub/使用说明.md) | 中控监控、全屏趋势卡两列布局 |
| [docs/trend-hub-close-and-trade-records.md](./docs/trend-hub-close-and-trade-records.md) | 中控平仓、交易记录写入、补仓展示统一、漏记补录 |