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:
@@ -293,3 +293,46 @@ def format_auto_confirm_line(confirm_ok: bool, cfm_close, edge_price, direction:
|
||||
f"第二根确认:{'通过' if confirm_ok else '不通过'}"
|
||||
f"(确认收盘 {cfm_close},须收于{side},关键位 {edge_price})"
|
||||
)
|
||||
|
||||
|
||||
def key_monitor_rule_template_context(
|
||||
*,
|
||||
kline_timeframe: str,
|
||||
key_breakout_amp_min_pct: float,
|
||||
key_volume_ma_bars: int,
|
||||
key_volume_ratio_min: float,
|
||||
key_auto_min_planned_rr: float,
|
||||
key_daily_volume_rank_max: int,
|
||||
key_confirm_breakout_bar: int,
|
||||
key_confirm_bar: int,
|
||||
key_alert_max_times: int,
|
||||
key_alert_interval_minutes: int,
|
||||
key_stop_outside_breakout_pct: float,
|
||||
key_trend_stop_outside_pct: float,
|
||||
false_breakout_validity_hours: int,
|
||||
) -> dict[str, Any]:
|
||||
"""关键位监控页规则说明表格(Jinja key_rule_ctx)。"""
|
||||
from false_breakout_key_monitor_lib import (
|
||||
FALSE_BREAKOUT_OFFSET_PCT,
|
||||
FALSE_BREAKOUT_RR,
|
||||
FALSE_BREAKOUT_SL_PCT,
|
||||
)
|
||||
|
||||
return {
|
||||
"tf": (kline_timeframe or "5m").strip(),
|
||||
"amp_min_pct": key_breakout_amp_min_pct,
|
||||
"vol_ma_bars": key_volume_ma_bars,
|
||||
"vol_ratio_min": key_volume_ratio_min,
|
||||
"min_rr": key_auto_min_planned_rr,
|
||||
"vol_rank_max": key_daily_volume_rank_max,
|
||||
"breakout_bar": key_confirm_breakout_bar,
|
||||
"confirm_bar": key_confirm_bar,
|
||||
"alert_max": key_alert_max_times,
|
||||
"alert_interval_min": key_alert_interval_minutes,
|
||||
"stop_outside_pct": key_stop_outside_breakout_pct,
|
||||
"trend_stop_outside_pct": key_trend_stop_outside_pct,
|
||||
"fb_offset_pct": FALSE_BREAKOUT_OFFSET_PCT,
|
||||
"fb_sl_pct": FALSE_BREAKOUT_SL_PCT,
|
||||
"fb_rr": FALSE_BREAKOUT_RR,
|
||||
"fb_valid_hours": false_breakout_validity_hours,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user