From 3527c2671747b564d77d69f65edf8783a33bc397 Mon Sep 17 00:00:00 2001 From: dekun Date: Tue, 9 Jun 2026 16:39:36 +0800 Subject: [PATCH] feat: collapse trade/strategy rule tips and color-code key history outcomes Co-authored-by: Cursor --- crypto_monitor_binance/templates/index.html | 16 +------ crypto_monitor_gate/templates/index.html | 16 +------ crypto_monitor_gate_bot/templates/index.html | 16 +------ crypto_monitor_okx/templates/index.html | 16 +------ static/instance_theme.css | 45 +++++++++++++++++++ strategy_templates/key_monitor_panel.html | 43 ++++++++++++++++-- .../order_monitor_rule_tips_binance.html | 21 +++++++++ .../order_monitor_rule_tips_gate.html | 21 +++++++++ .../order_monitor_rule_tips_gate_bot.html | 21 +++++++++ .../order_monitor_rule_tips_okx.html | 21 +++++++++ strategy_templates/strategy_roll_panel.html | 20 ++++++--- .../strategy_trend_disabled_panel.html | 13 +++--- strategy_templates/strategy_trend_panel.html | 13 +++--- 13 files changed, 202 insertions(+), 80 deletions(-) create mode 100644 strategy_templates/order_monitor_rule_tips_binance.html create mode 100644 strategy_templates/order_monitor_rule_tips_gate.html create mode 100644 strategy_templates/order_monitor_rule_tips_gate_bot.html create mode 100644 strategy_templates/order_monitor_rule_tips_okx.html diff --git a/crypto_monitor_binance/templates/index.html b/crypto_monitor_binance/templates/index.html index 66a691b..b46331d 100644 --- a/crypto_monitor_binance/templates/index.html +++ b/crypto_monitor_binance/templates/index.html @@ -333,21 +333,7 @@ 暂无持仓可放大 {% endif %} -
- 规则:最多 {{ max_active_positions }} 仓;BTC {{ btc_leverage }}x / 山寨 {{ alt_leverage }}x; - 本交易日开仓 {{ opens_today }}{% if daily_open_hard_limit > 0 %} / 硬上限 {{ daily_open_hard_limit }}{% endif %}(AI 提醒 {{ daily_open_alert_threshold }}); - {% if can_trade %}可开仓{% else %}不可开仓(持仓已满、单日开仓达上限,或未到北京时间 {{ reset_hour }}:00){% endif %}; - 人工开仓盈亏比不得低于 {{ manual_min_planned_rr }}:1 -
-
- 计仓模式:{{ position_sizing_mode_label }}(仅 .env POSITION_SIZING_MODE,须无仓后重启) - {% if position_sizing_mode == 'full_margin' %} - |全仓:合约可用×{{ full_margin_buffer_ratio }},BTC/ETH {{ btc_leverage }}x、其它 {{ alt_leverage }}x,单仓;张数按交易所精度 - {% else %} - |以损定仓:风险 {{ risk_percent }}% - {% endif %} - |移动保本:下单可勾选关闭;开启时 {{ breakeven_rr_trigger }}R 触发(每 1R 阶梯上移),偏移 {{ breakeven_offset_pct }}% -
+ {% include 'order_monitor_rule_tips_binance.html' %}
划转规则说明
diff --git a/crypto_monitor_gate/templates/index.html b/crypto_monitor_gate/templates/index.html index b3d8df3..5dce04c 100644 --- a/crypto_monitor_gate/templates/index.html +++ b/crypto_monitor_gate/templates/index.html @@ -333,21 +333,7 @@ 暂无持仓可放大 {% endif %}
-
- 规则:最多 {{ max_active_positions }} 仓;BTC {{ btc_leverage }}x / 山寨 {{ alt_leverage }}x; - 本交易日开仓 {{ opens_today }}{% if daily_open_hard_limit > 0 %} / 硬上限 {{ daily_open_hard_limit }}{% endif %}(AI 提醒 {{ daily_open_alert_threshold }}); - {% if can_trade %}可开仓{% else %}不可开仓(持仓已满、单日开仓达上限,或未到北京时间 {{ reset_hour }}:00){% endif %}; - 人工开仓盈亏比不得低于 {{ manual_min_planned_rr }}:1 -
-
- 计仓模式:{{ position_sizing_mode_label }}(仅 .env POSITION_SIZING_MODE,须无仓后重启) - {% if position_sizing_mode == 'full_margin' %} - |全仓:合约可用×{{ full_margin_buffer_ratio }},BTC/ETH {{ btc_leverage }}x、其它 {{ alt_leverage }}x,单仓;张数按交易所精度 - {% else %} - |以损定仓:风险 {{ risk_percent }}% - {% endif %} - |移动保本:下单可勾选关闭;开启时 {{ breakeven_rr_trigger }}R 触发(每 1R 阶梯上移),偏移 {{ breakeven_offset_pct }}% -
+ {% include 'order_monitor_rule_tips_gate.html' %}
@@ -28,7 +31,10 @@
-

执行前可用开发者工具 POST /strategy/roll/preview 查看 JSON 预览。

+
+ 滚仓预览接口说明 +
执行前可用开发者工具 POST /strategy/roll/preview 查看 JSON 预览。
+

活跃滚仓组

diff --git a/strategy_templates/strategy_trend_disabled_panel.html b/strategy_templates/strategy_trend_disabled_panel.html index 5bc5013..8b8076a 100644 --- a/strategy_templates/strategy_trend_disabled_panel.html +++ b/strategy_templates/strategy_trend_disabled_panel.html @@ -1,11 +1,14 @@ {% include 'strategy_subnav.html' %}

趋势回调

-
{{ trend_disabled_note }}
-
- 趋势回调含自动补仓档位与预览执行,仅在 Gate 趋势机器人crypto_monitor_gate_bot)实例中运行。 - 请访问该实例同一菜单「策略交易 → 趋势回调」,或常用地址 :5002/strategy/trend。 -
+
+ 趋势回调说明(本实例未启用) +
+ {{ trend_disabled_note }}

+ 趋势回调含自动补仓档位与预览执行,仅在 Gate 趋势机器人crypto_monitor_gate_bot)实例中运行。 + 请访问该实例同一菜单「策略交易 → 趋势回调」,或常用地址 :5002/strategy/trend。 +
+

返回实盘下单顺势加仓(本实例可用) diff --git a/strategy_templates/strategy_trend_panel.html b/strategy_templates/strategy_trend_panel.html index 6c54c8f..ab42b6e 100644 --- a/strategy_templates/strategy_trend_panel.html +++ b/strategy_templates/strategy_trend_panel.html @@ -2,11 +2,14 @@ {% macro amt_disp(sym, val) %}{% if amt_fmt is defined %}{{ amt_fmt(sym, val) }}{% else %}{{ val }}{% endif %}{% endmacro %}

趋势回调

-
- ① 生成预览:读取合约 USDT 可用余额快照并计算计划(不下单)。预览有效期 {{ trend_pullback_preview_ttl }} 秒
- ② 确认执行:市价首仓 50% + 挂交易所止损;首仓后可手动保本(默认均价+{{ trend_manual_breakeven_offset_pct }}%);剩余 50% 在止损与补仓区间之间共 {{ trend_pullback_dca_legs }} 档(做多为上沿、做空为下沿;程序可能因最小张数自动减档)市价补仓;止盈由程序监控
- 确认执行时若当前可用余额与预览快照相对偏差 > {{ trend_preview_max_drift_pct }}% 会拒绝并要求重新预览。 -
+
+ 趋势回调规则说明 +
+ ① 生成预览:读取合约 USDT 可用余额快照并计算计划(不下单)。预览有效期 {{ trend_pullback_preview_ttl }} 秒
+ ② 确认执行:市价首仓 50% + 挂交易所止损;首仓后可手动保本(默认均价+{{ trend_manual_breakeven_offset_pct }}%);剩余 50% 在止损与补仓区间之间共 {{ trend_pullback_dca_legs }} 档(做多为上沿、做空为下沿;程序可能因最小张数自动减档)市价补仓;止盈由程序监控
+ 确认执行时若当前可用余额与预览快照相对偏差 > {{ trend_preview_max_drift_pct }}% 会拒绝并要求重新预览。 +
+
{% if trend_dca_probes %} {% for p in trend_dca_probes %} {% if p.trigger_reached and p.block_reason %}