feat: show force-close badge and countdown when FORCE_CLOSE is enabled

Add shared lib/UI for midnight force-close indicator on instance and hub pages, and document Gate intraday 0-point exit alignment.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-06 02:17:47 +08:00
parent 7fb87d6030
commit a268a93027
22 changed files with 974 additions and 18 deletions
+8 -4
View File
@@ -6,16 +6,19 @@
|------|------|------|
| [binance-alt-trend-long.md](./binance-alt-trend-long.md) | 币安山寨·多头趋势 | v0.2 |
| [okx-trend-both.md](./okx-trend-both.md) | OKX·多空趋势 | v0.2 |
| gate-intraday.md | Gate·BTC/ETH 日内 | **待定** |
| [gate-intraday.md](./gate-intraday.md) | Gate·BTC 日内 | v0.2 |
## 约定
- **不写盈亏比**止盈/止损随行情人工设定,不写入策略 MD
- **界面短标签**`大分歧A` / `大分歧B` / `小分歧`;全称在 option `title` / 策略 MD 说明
- **不写盈亏比(趋势户)**:币安/OKX 止盈/止损随行情人工设定,趋势 MD 不量化 RR
- **日内例外**Gate 日内 **最低 1:1** 才开仓,持仓目标可动态调整(见 [gate-intraday.md](./gate-intraday.md)
- **界面短标签(趋势户)**`大分歧A` / `大分歧B` / `小分歧`;全称在 option `title` / 策略 MD。
- **界面短标签(日内户)**`假破` / `结构突破`
- **多空共用三字**:方向由「做多/做空」表达,不复用为「大分歧A多」等。
- **自动联动**:大分歧 A/B → 趋势单;**小分歧 → 波段单**;平仓写入交易记录 `entry_reason`;复盘「填入」自动带入。
- **杠杆默认**BTC/ETH **10x**,其它 **5x**;与开仓类型无关(env `BTC_LEVERAGE` / `ALT_LEVERAGE`)。
- **日内 profile 独立**env 启用 `TRADE_SYMBOL_WHITELIST=BTC,ETH` 且限制开启时,**不显示**上述三项(Gate 当前);日内开仓类型后续单独定义
- **日内 profile 独立**env 启用 `TRADE_SYMBOL_WHITELIST=BTC,ETH` 且限制开启时,**不显示** 大分歧三项(Gate);开仓类型为 **假破 / 结构突破**(见 gate-intraday.md
- **日内 0 点出场**:策略称「0 点平仓」;程序为 `FORCE_CLOSE_ENABLED` + `FORCE_CLOSE_BJ_HOUR=0`,交易记录 `result=强制清仓`(与表单 1h/2h/4h `time_close` 无关)。
- **策略模块独立**:趋势回调、顺势加仓不走上述三项。
## 系统实现
@@ -23,6 +26,7 @@
- 库:`lib/trade/entry_model_lib.py`
- 趋势户表单:`lib/instance/templates/order_entry_model_fields.html`
- 日内判定:`is_intraday_trading_profile()`(白名单仅含 BTC/ETH
- 0 点强平:`force_close_before_reset()`(三所 `app.py`);env `FORCE_CLOSE_ENABLED` / `FORCE_CLOSE_BJ_HOUR`
## 相关文档