开单计划增加决策理由;品种联想加速;复盘支持品种匹配

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-15 13:15:06 +08:00
parent db2443273f
commit eaf72a13fc
5 changed files with 196 additions and 43 deletions
+13 -7
View File
@@ -10,7 +10,7 @@
<form action="{{ url_for('add_plan') }}" method="post" class="form-compact">
<div class="form-line line-3">
<div class="symbol-wrap">
<input type="text" class="symbol-input" placeholder="中文名或同花顺代码" autocomplete="off" required>
<input type="text" class="symbol-input" placeholder="品种" autocomplete="off" required>
<input type="hidden" name="symbol" required>
<input type="hidden" name="symbol_name">
<input type="hidden" name="market_code" required>
@@ -23,10 +23,11 @@
<option value="long">做多</option>
<option value="short">做空</option>
</select>
<input name="zone_lower" type="number" step="0.0001" placeholder="区间下限" required>
<input name="decision_reason" type="text" placeholder="决策理由">
</div>
<div class="form-line line-3">
<input name="zone_upper" type="number" step="0.0001" placeholder="区间限" required>
<div class="form-line line-4">
<input name="zone_lower" type="number" step="0.0001" placeholder="决策区间限" required>
<input name="zone_upper" type="number" step="0.0001" placeholder="决策区间上限" required>
<input name="stop_loss" type="number" step="0.0001" placeholder="止损" required>
<input name="take_profit" type="number" step="0.0001" placeholder="止盈" required>
</div>
@@ -44,7 +45,11 @@
{% if p.status == 'planned' %}<span class="badge planned">待触发</span>
{% else %}<span class="badge active">已激活</span>{% endif %}
</div>
<div>{{ p.zone_lower }}~{{ p.zone_upper }} 损{{ p.stop_loss }} 盈{{ p.take_profit }}</div>
<div>
区间{{ p.zone_lower }}~{{ p.zone_upper }}
{% if p.decision_reason %} · {{ p.decision_reason }}{% endif %}
· 损{{ p.stop_loss }} 盈{{ p.take_profit }}
</div>
<a href="{{ url_for('del_plan', pid=p.id) }}" class="btn-del" onclick="return confirm('删除?')"></a>
</div>
{% else %}
@@ -65,7 +70,7 @@
</form>
<div class="card-scroll">
<table>
<thead><tr><th>日期</th><th>品种</th><th>方向</th><th>区间</th><th>状态</th></tr></thead>
<thead><tr><th>日期</th><th>品种</th><th>方向</th><th>决策区间</th><th>决策理由</th><th>状态</th></tr></thead>
<tbody>
{% for p in history %}
<tr>
@@ -73,6 +78,7 @@
<td>{{ p.symbol_name or p.symbol }}</td>
<td><span class="badge dir">{{ '多' if p.direction == 'long' else '空' }}</span></td>
<td>{{ p.zone_lower }}~{{ p.zone_upper }}</td>
<td>{{ p.decision_reason or '—' }}</td>
<td>
{% if p.status == 'closed' %}<span class="badge profit">完成</span>
{% elif p.status == 'expired' %}<span class="badge expired">失效</span>
@@ -80,7 +86,7 @@
</td>
</tr>
{% else %}
<tr><td colspan="5" class="text-muted">暂无历史</td></tr>
<tr><td colspan="6" class="text-muted">暂无历史</td></tr>
{% endfor %}
</tbody>
</table>
+11 -3
View File
@@ -7,7 +7,15 @@
<div class="card-body">
<form id="review-form" action="{{ url_for('add_review') }}" method="post" enctype="multipart/form-data" class="form-compact form-compact-review line-tight">
<div class="form-line line-4">
<input name="symbol" placeholder="品种 ag2608" required>
<div class="symbol-wrap">
<input type="text" class="symbol-input" placeholder="品种" autocomplete="off" required>
<input type="hidden" name="symbol" required>
<input type="hidden" name="symbol_name">
<input type="hidden" name="market_code" required>
<input type="hidden" name="sina_code">
<div class="symbol-dropdown"></div>
<div class="symbol-selected"></div>
</div>
<select name="direction" required>
<option value="">方向</option>
<option value="long">做多</option>
@@ -101,7 +109,7 @@
{% for r in reviews %}
<tr>
<td>{{ r.close_time[:16] if r.close_time else '' }}</td>
<td>{{ r.symbol }}</td>
<td>{{ r.symbol_name or r.symbol }}</td>
<td><span class="badge dir">{{ '多' if r.direction == 'long' else '空' }}</span></td>
<td>
{% if r.pnl and r.pnl > 0 %}<span class="badge profit">{{ r.pnl }}</span>
@@ -111,7 +119,7 @@
<td>{% if r.is_emotion %}<span class="badge loss">情绪</span>{% else %}-{% endif %}</td>
<td>
<button type="button" class="btn-link review-view-btn" data-review='{{ {
"symbol": r.symbol, "direction": "做多" if r.direction=="long" else "做空",
"symbol": r.symbol_name or r.symbol, "symbol_code": r.symbol, "direction": "做多" if r.direction=="long" else "做空",
"entry_price": r.entry_price, "stop_loss": r.stop_loss, "take_profit": r.take_profit,
"close_price": r.close_price, "lots": r.lots,
"open_time": r.open_time, "close_time": r.close_time,