87aef80594
程序报单状态与推荐表内嵌同一页面,/recommend 跳转至 #recommend。 Co-authored-by: Cursor <cursoragent@cursor.com>
65 lines
3.5 KiB
HTML
65 lines
3.5 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}策略交易 - 国内期货监控系统{% endblock %}
|
|
{% block content %}
|
|
<div class="split-grid">
|
|
<div class="card">
|
|
<h2>趋势回调</h2>
|
|
{% if active_trend %}
|
|
<p class="hint">运行中 #{{ active_trend.id }} {{ active_trend.symbol }} {{ active_trend.direction }}
|
|
已开 {{ active_trend.lots_open or 0 }}/{{ active_trend.target_lots }} 手</p>
|
|
<form id="trend-stop-form" class="form-row">
|
|
<input type="hidden" name="plan_id" value="{{ active_trend.id }}">
|
|
<button type="button" class="btn-primary" id="btn-trend-stop">结束计划</button>
|
|
</form>
|
|
{% else %}
|
|
<form id="trend-form" class="form-compact">
|
|
<div class="form-line line-2">
|
|
<div class="symbol-wrap"><input class="symbol-input" name="symbol" placeholder="合约" required><div class="symbol-dropdown"></div></div>
|
|
<select name="direction"><option value="long">做多</option><option value="short">做空</option></select>
|
|
</div>
|
|
<div class="form-line line-3">
|
|
<input name="stop_loss" type="number" step="any" placeholder="止损" required>
|
|
<input name="add_upper" type="number" step="any" placeholder="补仓边界" required>
|
|
<input name="take_profit" type="number" step="any" placeholder="止盈" required>
|
|
</div>
|
|
<div class="form-line line-2">
|
|
<input name="risk_percent" type="number" step="0.1" value="{{ risk_percent }}" placeholder="风险%">
|
|
<button type="button" class="btn-primary" id="btn-trend-preview">预览</button>
|
|
</div>
|
|
</form>
|
|
<pre id="trend-preview" class="hint" style="white-space:pre-wrap;margin-top:.75rem"></pre>
|
|
<button type="button" class="btn-primary" id="btn-trend-exec" hidden>确认执行首仓</button>
|
|
{% endif %}
|
|
</div>
|
|
<div class="card">
|
|
<h2>顺势加仓(滚仓)</h2>
|
|
<p class="hint">须先有「下单监控」持仓;最多 3 腿;止盈锁首仓。</p>
|
|
{% if monitors %}
|
|
<form id="roll-form" class="form-compact">
|
|
<select name="monitor_id" required>
|
|
{% for m in monitors %}
|
|
<option value="{{ m.id }}">{{ m.symbol }} {{ m.direction }} {{ m.lots }}手</option>
|
|
{% endfor %}
|
|
</select>
|
|
<div class="form-line line-2">
|
|
<input name="new_stop_loss" type="number" step="any" placeholder="新统一止损" required>
|
|
<input name="risk_percent" type="number" step="0.1" value="2" placeholder="总风险%">
|
|
</div>
|
|
<div class="form-line line-2">
|
|
<input name="add_price" type="number" step="any" placeholder="加仓参考价">
|
|
<button type="button" class="btn-primary" id="btn-roll-preview">预览</button>
|
|
</div>
|
|
<pre id="roll-preview" class="hint" style="white-space:pre-wrap"></pre>
|
|
<button type="button" class="btn-primary" id="btn-roll-exec" hidden>执行滚仓</button>
|
|
</form>
|
|
{% else %}
|
|
<p class="empty-hint">请先在「持仓监控 → 期货下单」进入策略交易开仓。</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<p class="hint"><a href="{{ url_for('strategy_records_page') }}">策略交易记录 →</a></p>
|
|
{% endblock %}
|
|
{% block extra_js %}
|
|
<script src="{{ url_for('static', filename='js/strategy.js') }}"></script>
|
|
{% endblock %}
|