feat: add tabular key monitor rule reference on all exchanges
Replace the pipe-separated rule blurb with a detailed five-column table driven by .env-backed gate parameters for easier trading reference. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -133,6 +133,7 @@ from key_monitor_lib import (
|
||||
detect_rs_box_break,
|
||||
format_auto_amp_line,
|
||||
format_auto_confirm_line,
|
||||
key_monitor_rule_template_context,
|
||||
notify_interval_elapsed,
|
||||
resolve_rs_break_for_alert,
|
||||
rs_break_from_direction,
|
||||
@@ -6125,12 +6126,20 @@ def render_main_page(page="trade"):
|
||||
opens_today=opens_today,
|
||||
hard_limit=DAILY_OPEN_HARD_LIMIT,
|
||||
)
|
||||
key_gate_rule_text = (
|
||||
f"【箱体/收敛】{KLINE_TIMEFRAME} 两根闭合K|突破越过关键位 > {KEY_BREAKOUT_AMP_MIN_PCT}%|"
|
||||
f"确认K收于箱外|量能>前{KEY_VOLUME_MA_BARS}均量×{KEY_VOLUME_RATIO_MIN}|"
|
||||
f"RR>{KEY_AUTO_MIN_PLANNED_RR}|日成交前{KEY_DAILY_VOLUME_RANK_MAX}|"
|
||||
f"【假突破·BTC/ETH】做空填高点/做多填低点,外侧 0.1% 挂限价,止损 0.5%,RR 1.5,有效期 {FALSE_BREAKOUT_VALIDITY_HOURS}h|"
|
||||
f"【阻力/支撑】填上/下沿,5m 收盘突破任一侧即提醒 {KEY_ALERT_MAX_TIMES} 次(间隔 {KEY_ALERT_INTERVAL_MINUTES} 分),不选方向、不自动开仓"
|
||||
key_rule_ctx = key_monitor_rule_template_context(
|
||||
kline_timeframe=KLINE_TIMEFRAME,
|
||||
key_breakout_amp_min_pct=KEY_BREAKOUT_AMP_MIN_PCT,
|
||||
key_volume_ma_bars=KEY_VOLUME_MA_BARS,
|
||||
key_volume_ratio_min=KEY_VOLUME_RATIO_MIN,
|
||||
key_auto_min_planned_rr=KEY_AUTO_MIN_PLANNED_RR,
|
||||
key_daily_volume_rank_max=KEY_DAILY_VOLUME_RANK_MAX,
|
||||
key_confirm_breakout_bar=KEY_CONFIRM_BREAKOUT_BAR,
|
||||
key_confirm_bar=KEY_CONFIRM_BAR,
|
||||
key_alert_max_times=KEY_ALERT_MAX_TIMES,
|
||||
key_alert_interval_minutes=KEY_ALERT_INTERVAL_MINUTES,
|
||||
key_stop_outside_breakout_pct=KEY_STOP_OUTSIDE_BREAKOUT_PCT,
|
||||
key_trend_stop_outside_pct=KEY_TREND_STOP_OUTSIDE_PCT,
|
||||
false_breakout_validity_hours=FALSE_BREAKOUT_VALIDITY_HOURS,
|
||||
)
|
||||
strategy_extra = {}
|
||||
if page in ("strategy", "strategy_trend", "strategy_roll", "strategy_records"):
|
||||
@@ -6209,7 +6218,7 @@ def render_main_page(page="trade"):
|
||||
max_active_positions=MAX_ACTIVE_POSITIONS,
|
||||
manual_min_planned_rr=MANUAL_MIN_PLANNED_RR,
|
||||
key_auto_min_planned_rr=KEY_AUTO_MIN_PLANNED_RR,
|
||||
key_gate_rule_text=key_gate_rule_text,
|
||||
key_rule_ctx=key_rule_ctx,
|
||||
kline_timeframe=KLINE_TIMEFRAME,
|
||||
**strategy_extra,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user