Improve key monitor form with bar period, box direction, and labeled fields.
Match order-monitor layout; persist bar_period and enforce upper-direction filter for box breakouts. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2933,6 +2933,7 @@ def install_trading(app, *, login_required, require_nav, get_db, get_setting, se
|
||||
def _execute_key_breakout(conn, row, bar, break_side):
|
||||
"""关键位箱体/收敛:5m 收盘突破后自动市价开仓。"""
|
||||
from key_monitor_lib import (
|
||||
TYPE_BOX,
|
||||
calc_breakout_sl_tp,
|
||||
format_auto_breakout_msg,
|
||||
normalize_monitor_type,
|
||||
@@ -2966,6 +2967,13 @@ def install_trading(app, *, login_required, require_nav, get_db, get_setting, se
|
||||
detail=detail,
|
||||
))
|
||||
|
||||
if monitor_type == TYPE_BOX:
|
||||
cfg_dir = (row.get("direction") or "").strip().lower()
|
||||
if cfg_dir in ("long", "short") and direction != cfg_dir:
|
||||
dir_cn = "做多" if cfg_dir == "long" else "做空"
|
||||
_notify(False, f"突破方向与上方向({dir_cn})不一致", entry=0, sl=0, tp=0, lots=0)
|
||||
return False, "突破方向与上方向不一致"
|
||||
|
||||
try:
|
||||
init_strategy_tables(conn)
|
||||
mode = get_trading_mode(get_setting)
|
||||
|
||||
Reference in New Issue
Block a user