From 073a382d41b65da209a664f77fd93c236882f5db Mon Sep 17 00:00:00 2001 From: dekun Date: Fri, 19 Jun 2026 08:31:14 +0800 Subject: [PATCH] Unify key support/resistance monitor type and fix form parity. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge 关键阻力位/关键支撑位 into 关键支撑阻力, share key_monitor_form.js across hub and new-tab views, and add hub shortcut to /key_monitor. Co-authored-by: Cursor --- crypto_monitor_binance/app.py | 6 +- crypto_monitor_binance/templates/index.html | 114 +------------- crypto_monitor_gate/app.py | 6 +- crypto_monitor_gate/templates/index.html | 114 +------------- crypto_monitor_gate_bot/app.py | 6 +- crypto_monitor_gate_bot/templates/index.html | 114 +------------- crypto_monitor_okx/app.py | 6 +- crypto_monitor_okx/templates/index.html | 115 +------------- hub_bridge.py | 1 + key_monitor_lib.py | 23 ++- manual_trading_hub/static/app.js | 7 +- static/key_monitor_form.js | 148 ++++++++++++++++++ strategy_templates/key_monitor_panel.html | 14 +- strategy_templates/key_monitor_rule_tips.html | 2 +- tests/test_key_monitor_rs_type.py | 27 ++++ 15 files changed, 233 insertions(+), 470 deletions(-) create mode 100644 static/key_monitor_form.js create mode 100644 tests/test_key_monitor_rs_type.py diff --git a/crypto_monitor_binance/app.py b/crypto_monitor_binance/app.py index 2841336..6124380 100644 --- a/crypto_monitor_binance/app.py +++ b/crypto_monitor_binance/app.py @@ -158,6 +158,7 @@ from key_monitor_lib import ( KEY_DIRECTION_WATCH, KEY_MONITOR_ALERT_ONLY_TYPES, KEY_MONITOR_AUTO_TYPES, + KEY_MONITOR_RS_TYPE, KEY_MONITOR_RS_TYPES, auto_amp_ok, auto_confirm_ok, @@ -7792,6 +7793,7 @@ def add_key(): return redirect("/key_monitor") if mt in KEY_MONITOR_RS_TYPES: direction_sel = KEY_DIRECTION_WATCH + mt = KEY_MONITOR_RS_TYPE elif direction_sel not in ("long", "short"): flash("箱体/收敛突破请选择做多或做空") return redirect("/key_monitor") @@ -7828,7 +7830,7 @@ def add_key(): conn.close() flash( f"当前持仓已达上限({occupied}/{MAX_ACTIVE_POSITIONS}):无法添加「箱体突破 / 收敛突破」。" - "请平仓后再试,或使用「关键阻力位/关键支撑位」(仅单次提醒)。" + "请平仓后再试,或使用「关键支撑阻力」(仅提醒)。" ) return redirect("/key_monitor") ex_sym_key = normalize_exchange_symbol(symbol) @@ -8004,7 +8006,7 @@ def add_key(): extra = f"|方案:{sl_tp_mode_label(sl_tp_mode)}|移动保本:{'开' if be_flag else '关'}" if mt in KEY_MONITOR_RS_TYPES: flash( - f"添加成功({symbol} 日成交量排名 {rank}/{total})|阻力/支撑:双向监控上/下沿," + f"添加成功({symbol} 日成交量排名 {rank}/{total})|关键支撑阻力:双向监控上/下沿," f"5m 收盘突破后微信提醒 {KEY_ALERT_MAX_TIMES} 次(间隔 {KEY_ALERT_INTERVAL_MINUTES} 分钟)" ) else: diff --git a/crypto_monitor_binance/templates/index.html b/crypto_monitor_binance/templates/index.html index ab5f32f..0fcd2dc 100644 --- a/crypto_monitor_binance/templates/index.html +++ b/crypto_monitor_binance/templates/index.html @@ -629,8 +629,7 @@ - - + - - + - - +