feat: CTP 断线重连、下单卡片优化、手数自动计算
后台每 30s 检测并重连;以损定仓填止损后自动算手数;开仓/平仓按钮并排对齐。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+5
-11
@@ -15,7 +15,8 @@
|
||||
{% if ctp_account.available is defined and ctp_status.connected %}
|
||||
<span class="text-muted">可用 <strong id="avail-display">{{ '%.2f'|format(ctp_account.available) }}</strong> 元</span>
|
||||
{% endif %}
|
||||
<button type="button" class="btn-primary" id="btn-ctp-connect" style="padding:.4rem .9rem;font-size:.8rem">连接 CTP</button>
|
||||
<button type="button" class="btn-primary" id="btn-ctp-connect" style="padding:.4rem .9rem;font-size:.8rem">{% if ctp_status.connected %}重连 CTP{% else %}连接 CTP{% endif %}</button>
|
||||
<span class="text-muted" style="font-size:.72rem">断线自动重连</span>
|
||||
</div>
|
||||
|
||||
<div class="trade-dashboard">
|
||||
@@ -46,9 +47,10 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="trade-field" id="field-lots" {% if sizing_mode == 'risk' %}hidden{% endif %}>
|
||||
<div class="trade-field" id="field-lots">
|
||||
<label class="text-label">手数</label>
|
||||
<input type="number" id="trade-lots" min="1" step="1" value="1">
|
||||
<input type="number" id="trade-lots" min="1" step="1" value="1" {% if sizing_mode == 'risk' %}hidden{% endif %}>
|
||||
<input type="text" id="trade-lots-calc" class="lots-auto" readonly placeholder="填写止损后自动计算" {% if sizing_mode != 'risk' %}hidden{% endif %}>
|
||||
</div>
|
||||
|
||||
<div class="trade-field span-2">
|
||||
@@ -69,14 +71,6 @@
|
||||
<label class="text-label">止盈</label>
|
||||
<input type="number" id="trade-tp" step="any">
|
||||
</div>
|
||||
|
||||
<div class="trade-field" id="field-calc-lots" {% if sizing_mode != 'risk' %}hidden{% endif %}>
|
||||
<label class="text-label">计算手数</label>
|
||||
<div class="calc-lots-row">
|
||||
<input type="text" id="trade-lots-calc" readonly placeholder="填写止损后计算">
|
||||
<button type="button" class="btn-secondary" id="btn-calc-lots">计算</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="trade-action-row">
|
||||
|
||||
Reference in New Issue
Block a user