feat(key-monitor): add program trigger entry across four exchanges
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -93,7 +93,7 @@
|
||||
|
||||
{% macro key_history_outcome_kind(h) -%}
|
||||
{%- set r = (h.close_reason or '')|trim -%}
|
||||
{%- if r in ['fib_filled', 'false_breakout_filled', 'key_level_alert_done', 'alerts_complete', 'auto_opened'] -%}success
|
||||
{%- if r in ['fib_filled', 'false_breakout_filled', 'trigger_entry_filled', 'key_level_alert_done', 'alerts_complete', 'auto_opened'] -%}success
|
||||
{%- elif r == 'manual' -%}manual
|
||||
{%- elif r -%}failed
|
||||
{%- else -%}neutral
|
||||
@@ -104,11 +104,15 @@
|
||||
{%- set r = (h.close_reason or '')|trim -%}
|
||||
{%- if r == 'fib_filled' -%}斐波成交
|
||||
{%- elif r == 'false_breakout_filled' -%}假突破成交
|
||||
{%- elif r == 'trigger_entry_filled' -%}触价成交
|
||||
{%- elif r == 'key_level_alert_done' -%}提醒完成
|
||||
{%- elif r == 'alerts_complete' -%}提醒已满
|
||||
{%- elif r == 'auto_opened' -%}自动开仓
|
||||
{%- elif r == 'manual' -%}手动删除
|
||||
{%- elif r == 'fib_invalidate' -%}斐波失效
|
||||
{%- elif r == 'trigger_tp_invalidate' -%}触价止盈失效
|
||||
{%- elif r == 'trigger_entry_expired' -%}触价过期
|
||||
{%- elif r == 'trigger_exchange_failed' -%}触价下单失败
|
||||
{%- elif r == 'false_breakout_expired' -%}假突破过期
|
||||
{%- elif r == 'fib_plan_invalid' -%}计划无效
|
||||
{%- elif r == 'rr_insufficient' -%}盈亏比不足
|
||||
@@ -133,12 +137,15 @@
|
||||
</div>
|
||||
<form id="key-form" action="/add_key" method="post" class="form-row">
|
||||
<input name="symbol" placeholder="BTC 或 BTC/USDT" required>
|
||||
<select name="type" required>
|
||||
<select name="type" id="key-type-select" required>
|
||||
{% if position_sizing_mode != 'full_margin' %}
|
||||
<option value="箱体突破">箱体突破</option>
|
||||
<option value="收敛突破">收敛突破</option>
|
||||
<option value="斐波回调0.618">斐波回调0.618</option>
|
||||
<option value="斐波回调0.786">斐波回调0.786</option>
|
||||
<option value="假突破">假突破(BTC/ETH)</option>
|
||||
{% endif %}
|
||||
<option value="触价开仓">触价开仓</option>
|
||||
<option value="关键阻力位">关键阻力位</option>
|
||||
<option value="关键支撑位">关键支撑位</option>
|
||||
</select>
|
||||
@@ -146,6 +153,9 @@
|
||||
<option value="">方向</option><option value="long">做多</option><option value="short">做空</option>
|
||||
</select>
|
||||
<input name="key_price" id="key-fb-price" step="0.0001" placeholder="做空填高点/做多填低点" style="display:none">
|
||||
<input name="trigger_entry" id="key-trigger-entry" step="0.0001" placeholder="计划入场价" style="display:none">
|
||||
<input name="trigger_sl" id="key-trigger-sl" step="0.0001" placeholder="止损价" style="display:none">
|
||||
<input name="trigger_tp" id="key-trigger-tp" step="0.0001" placeholder="止盈价" style="display:none">
|
||||
<input name="upper" id="key-upper" step="0.0001" placeholder="上沿/阻力" required>
|
||||
<input name="lower" id="key-lower" step="0.0001" placeholder="下沿/支撑" required>
|
||||
<select name="sl_tp_mode" id="key-sl-tp-mode" title="止盈止损方案">
|
||||
@@ -203,7 +213,7 @@
|
||||
<div class="pos-meta">
|
||||
<span class="pos-meta-item">上沿: {{ k.upper }}</span>
|
||||
<span class="pos-meta-item">下沿: {{ k.lower }}</span>
|
||||
{% if k.fib_entry_price %}<span class="pos-meta-item">挂E: {{ k.fib_entry_price }}</span>{% endif %}
|
||||
{% if k.fib_entry_price and k.monitor_type == '触价开仓' %}<span class="pos-meta-item">E: {{ k.fib_entry_price }} / SL: {{ k.fib_stop_loss }} / TP: {{ k.fib_take_profit }}</span>{% elif k.fib_entry_price %}<span class="pos-meta-item">挂E: {{ k.fib_entry_price }}</span>{% endif %}
|
||||
{% if k.monitor_type == '假突破' and k.fib_stop_loss %}<span class="pos-meta-item">SL: {{ k.fib_stop_loss }} / TP: {{ k.fib_take_profit }}</span>{% endif %}
|
||||
<span class="pos-meta-item">已提醒: {{ k.notification_count or 0 }}/{{ k.max_notify or 3 }}</span>
|
||||
{% if k.monitor_type in ['箱体突破','收敛突破'] %}
|
||||
@@ -275,6 +285,7 @@ function keySummaryIsPending(snap){
|
||||
const gm = String(snap.gate_metrics || "");
|
||||
if(gm.includes("限价单") || gm.includes("挂单")) return true;
|
||||
if(/等待成交/.test(gs)) return true;
|
||||
if(/触价待触发/.test(gs)) return true;
|
||||
if(/挂E=/.test(gs) && !gs.includes("将失效")) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user