feat(okx): auto-open on box/convergence key breakout like Gate/Binance

Replace alert-only check_key_monitors with market open flow, add _market_open_for_key_monitor, and update docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-03 16:08:32 +08:00
parent a5f4ad8e97
commit e265c1b31a
4 changed files with 361 additions and 70 deletions
@@ -117,7 +117,7 @@ KEY_TREND_STOP_OUTSIDE_PCT=1
| 实例 | 箱体/收敛触发后 |
|------|----------------|
| **Binance / Gate** | 门控通过 → 按方案算 SL/TP → 市价开仓 → 挂交易所 TP/SL → 写入下单监控 |
| **OKX** | 门控通过 → **企业微信提醒**(推送中含录入方案的计划 SL/TP/RR),**不自动市价开仓** |
| **OKX** | 门控通过 → **自动市价开仓**(与 Gate/Binance 相同;须 `LIVE_TRADING_ENABLED=true` |
OKX 用户按推送中的计划价自行下单;斐波仍为限价 + 成交后挂 TP/SL(与原先一致)。
@@ -147,7 +147,7 @@ OKX 用户按推送中的计划价自行下单;斐波仍为限价 + 成交后
3. **验证 Binance/Gate**
- 添加箱体突破,选「箱体1R·止盈1.5H」,不勾保本 → 触发后微信应显示方案名、保本关、SL/TP 符合 E±H / E±1.5H。
- 添加趋势单,填止盈,勾保本 → 成交后持仓卡片「移动保本:开」。
4. **验证 OKX**:门控通过时微信应含「录入方案」与计划 SL/TP,并注明提醒模式不自动开仓
4. **验证 OKX**:门控通过且 RR 达标时应自动市价开仓;失败时微信说明 `exchange_failed` / `rr_insufficient`
5. 旧关键位条目:列表应显示「方案:标准突破」「保本:关」(除非库中已有新字段值)。
---
@@ -159,6 +159,6 @@ OKX 用户按推送中的计划价自行下单;斐波仍为限价 + 成交后
| 计划 SL/TP | `plan_key_sl_tp()` in `key_sl_tp_lib.py` |
| 按监控行计算 | `_key_plan_sl_tp_for_row()` in各 `app.py` |
| 添加关键位 | `add_key()` |
| 箱体/收敛轮询 | `check_key_monitors()`OKX 仅提醒 |
| 箱体/收敛轮询 | `check_key_monitors()`四所共用自动开仓逻辑 |
| 斐波添加 | `_add_fib_key_monitor(..., breakeven_enabled=)` |
| 自动开仓写监控 | `_market_open_for_key_monitor(..., breakeven_enabled=)` |