双栏布局:开单计划/关键位/复盘;复盘字段与情绪单
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -63,6 +63,28 @@
|
||||
.filter-row{display:flex;gap:.75rem;flex-wrap:wrap;align-items:flex-end;margin-bottom:1rem}
|
||||
.filter-row .field{width:auto;min-width:140px}
|
||||
.filter-row button{width:auto}
|
||||
.split-grid{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;align-items:stretch;margin-bottom:1.5rem}
|
||||
.split-grid .card{margin-bottom:0;height:100%;min-height:560px;display:flex;flex-direction:column}
|
||||
.split-grid .card-body{flex:1;overflow:auto}
|
||||
.card-scroll{max-height:420px;overflow-y:auto}
|
||||
.preset-tabs{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem}
|
||||
.preset-tabs a{padding:.45rem .85rem;border-radius:8px;border:1px solid #2e2e45;color:#a9a9c4;text-decoration:none;font-size:.85rem}
|
||||
.preset-tabs a.active,.preset-tabs a:hover{background:#1e2533;color:#4cc2ff;border-color:#4cc2ff}
|
||||
.btn-link{color:#4cc2ff;cursor:pointer;font-size:.85rem;background:none;border:none;padding:0}
|
||||
.btn-link:hover{text-decoration:underline}
|
||||
.modal-mask{position:fixed;inset:0;background:rgba(0,0,0,.7);z-index:1000;display:none;align-items:center;justify-content:center;padding:1rem}
|
||||
.modal-mask.show{display:flex}
|
||||
.modal-box{background:#12121a;border:1px solid #242435;border-radius:16px;max-width:900px;width:100%;max-height:90vh;overflow:auto;padding:1.5rem}
|
||||
.modal-box h3{margin-bottom:1rem;color:#c4c4ff}
|
||||
.modal-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:.75rem;font-size:.9rem}
|
||||
.modal-grid .item label{color:#888;font-size:.75rem;display:block}
|
||||
.modal-grid .item div{margin-top:.2rem}
|
||||
.modal-close{float:right;color:#888;cursor:pointer;font-size:1.2rem}
|
||||
.calc-readonly{background:#161625;color:#4cc2ff}
|
||||
@media(max-width:1100px){
|
||||
.split-grid{grid-template-columns:1fr}
|
||||
.split-grid .card{min-height:auto}
|
||||
}
|
||||
@media(max-width:768px){
|
||||
.topbar-inner{flex-wrap:wrap;height:auto;padding:.75rem 0}
|
||||
.nav{order:3;width:100%}
|
||||
|
||||
+66
-43
@@ -3,51 +3,74 @@
|
||||
{% block content %}
|
||||
<h1 class="page-title">关键位监控</h1>
|
||||
|
||||
<div class="card">
|
||||
<h2>新增监控</h2>
|
||||
<form action="{{ url_for('add_key') }}" method="post" class="form-row">
|
||||
<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="type" required>
|
||||
<option value="箱体突破">箱体突破</option>
|
||||
<option value="收敛突破">收敛突破</option>
|
||||
<option value="关键阻力位">关键阻力位</option>
|
||||
<option value="关键支撑位">关键支撑位</option>
|
||||
</select>
|
||||
<select name="direction" required>
|
||||
<option value="">选择方向</option>
|
||||
<option value="long">做多</option>
|
||||
<option value="short">做空</option>
|
||||
</select>
|
||||
<input name="upper" type="number" step="0.0001" placeholder="上沿/阻力" required>
|
||||
<input name="lower" type="number" step="0.0001" placeholder="下沿/支撑" required>
|
||||
<button type="submit" class="btn-primary">添加监控</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>监控列表</h2>
|
||||
<div class="list">
|
||||
{% for k in keys %}
|
||||
<div class="list-item">
|
||||
<div>
|
||||
<strong>{{ k.symbol_name or k.symbol }}</strong> | {{ k.monitor_type }}
|
||||
<span class="badge dir">{{ '做多' if k.direction == 'long' else '做空' }}</span>
|
||||
<div class="split-grid">
|
||||
<div class="card">
|
||||
<h2>新增监控</h2>
|
||||
<div class="card-body">
|
||||
<form action="{{ url_for('add_key') }}" method="post" class="form-row">
|
||||
<div class="symbol-wrap" style="min-width:180px;flex:1">
|
||||
<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="type" required>
|
||||
<option value="箱体突破">箱体突破</option>
|
||||
<option value="收敛突破">收敛突破</option>
|
||||
<option value="关键阻力位">关键阻力位</option>
|
||||
<option value="关键支撑位">关键支撑位</option>
|
||||
</select>
|
||||
<select name="direction" required>
|
||||
<option value="">方向</option>
|
||||
<option value="long">做多</option>
|
||||
<option value="short">做空</option>
|
||||
</select>
|
||||
<input name="upper" type="number" step="0.0001" placeholder="上沿/阻力" required>
|
||||
<input name="lower" type="number" step="0.0001" placeholder="下沿/支撑" required>
|
||||
<button type="submit" class="btn-primary">添加</button>
|
||||
</form>
|
||||
<h3 style="font-size:.95rem;color:#a9a9ff;margin:1rem 0 .75rem">监控列表</h3>
|
||||
<div class="list card-scroll">
|
||||
{% for k in keys %}
|
||||
<div class="list-item">
|
||||
<div>
|
||||
<strong>{{ k.symbol_name or k.symbol }}</strong> | {{ k.monitor_type }}
|
||||
<span class="badge dir">{{ '做多' if k.direction == 'long' else '做空' }}</span>
|
||||
</div>
|
||||
<div>上 {{ k.upper }} | 下 {{ k.lower }}</div>
|
||||
<a href="{{ url_for('del_key', pid=k.id) }}" class="btn-del" onclick="return confirm('移入历史?')">删除</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div style="color:#888;padding:1rem">暂无监控</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div>上: {{ k.upper }} | 下: {{ k.lower }}</div>
|
||||
<div style="font-size:.8rem;color:#888">同花顺: {{ k.symbol }}</div>
|
||||
<a href="{{ url_for('del_key', pid=k.id) }}" class="btn-del" onclick="return confirm('删除?')">删除</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div style="color:#888;padding:1rem">暂无关键位监控</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>监控历史</h2>
|
||||
<div class="card-body card-scroll">
|
||||
<table>
|
||||
<thead><tr><th>品种</th><th>类型</th><th>方向</th><th>上沿</th><th>下沿</th><th>归档时间</th></tr></thead>
|
||||
<tbody>
|
||||
{% for k in history %}
|
||||
<tr>
|
||||
<td>{{ k.symbol_name or k.symbol }}</td>
|
||||
<td>{{ k.monitor_type }}</td>
|
||||
<td><span class="badge dir">{{ '多' if k.direction == 'long' else '空' }}</span></td>
|
||||
<td>{{ k.upper }}</td>
|
||||
<td>{{ k.lower }}</td>
|
||||
<td>{{ k.archived_at[:16] if k.archived_at else '' }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="6" style="color:#888">暂无历史</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
+75
-95
@@ -3,104 +3,84 @@
|
||||
{% block content %}
|
||||
<h1 class="page-title">开单计划 <span style="font-size:.9rem;color:#888;font-weight:normal">今日 {{ today }}</span></h1>
|
||||
|
||||
<div class="card">
|
||||
<h2>今日计划(开盘前制定,当日有效)</h2>
|
||||
<form action="{{ url_for('add_plan') }}" method="post" class="form-row">
|
||||
<div class="symbol-wrap" style="min-width:200px">
|
||||
<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>
|
||||
<option value="short">做空</option>
|
||||
</select>
|
||||
<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>
|
||||
<button type="submit" class="btn-primary">添加今日计划</button>
|
||||
</form>
|
||||
<p class="hint">计划仅当日有效,次日 0 点自动失效并归入历史;触发止盈/止损后标记为已完成。</p>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>今日进行中</h2>
|
||||
<div class="list">
|
||||
{% for p in plans %}
|
||||
<div class="list-item">
|
||||
<div>
|
||||
<strong>{{ p.symbol_name or p.symbol }}</strong>
|
||||
<span class="badge dir">{{ '做多' if p.direction == 'long' else '做空' }}</span>
|
||||
{% if p.status == 'planned' %}
|
||||
<span class="badge planned">待触发</span>
|
||||
<div class="split-grid">
|
||||
<div class="card">
|
||||
<h2>今日计划</h2>
|
||||
<div class="card-body">
|
||||
<p class="hint" style="margin-bottom:1rem">开盘前制定,当日有效;下方为进行中计划。</p>
|
||||
<form action="{{ url_for('add_plan') }}" method="post" class="form-row">
|
||||
<div class="symbol-wrap" style="min-width:180px;flex:1">
|
||||
<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>
|
||||
<option value="short">做空</option>
|
||||
</select>
|
||||
<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>
|
||||
<button type="submit" class="btn-primary">添加</button>
|
||||
</form>
|
||||
<h3 style="font-size:.95rem;color:#a9a9ff;margin:1rem 0 .75rem">进行中</h3>
|
||||
<div class="list card-scroll">
|
||||
{% for p in plans %}
|
||||
<div class="list-item">
|
||||
<div>
|
||||
<strong>{{ p.symbol_name or p.symbol }}</strong>
|
||||
<span class="badge dir">{{ '做多' if p.direction == 'long' else '做空' }}</span>
|
||||
{% 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>
|
||||
<a href="{{ url_for('del_plan', pid=p.id) }}" class="btn-del" onclick="return confirm('删除?')">删除</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<span class="badge active">已激活</span>
|
||||
{% endif %}
|
||||
<div style="color:#888;padding:1rem">今日暂无进行中的计划</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>历史计划</h2>
|
||||
<div class="card-body">
|
||||
<form method="get" class="filter-row">
|
||||
<div class="field"><label>开始</label><input type="date" name="start" value="{{ start }}"></div>
|
||||
<div class="field"><label>结束</label><input type="date" name="end" value="{{ end }}"></div>
|
||||
<button type="submit" class="btn-primary">筛选</button>
|
||||
<a href="{{ url_for('plans') }}" style="color:#888;font-size:.85rem;padding:.7rem">重置</a>
|
||||
</form>
|
||||
<div class="card-scroll">
|
||||
<table>
|
||||
<thead><tr><th>日期</th><th>品种</th><th>方向</th><th>区间</th><th>状态</th></tr></thead>
|
||||
<tbody>
|
||||
{% for p in history %}
|
||||
<tr>
|
||||
<td>{{ p.plan_date or '' }}</td>
|
||||
<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>
|
||||
{% if p.status == 'closed' %}<span class="badge profit">完成</span>
|
||||
{% elif p.status == 'expired' %}<span class="badge expired">失效</span>
|
||||
{% else %}{{ p.status }}{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="5" style="color:#888">暂无历史</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>区间: {{ p.zone_lower }} ~ {{ p.zone_upper }}</div>
|
||||
<div>止损: {{ p.stop_loss }} | 止盈: {{ p.take_profit }}</div>
|
||||
<div style="font-size:.8rem;color:#888">同花顺: {{ p.symbol }}</div>
|
||||
<a href="{{ url_for('del_plan', pid=p.id) }}" class="btn-del" onclick="return confirm('删除此计划?')">删除</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div style="color:#888;padding:1rem">今日暂无开单计划</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>历史计划</h2>
|
||||
<form method="get" class="filter-row">
|
||||
<div class="field">
|
||||
<label>开始日期</label>
|
||||
<input type="date" name="start" value="{{ start }}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>结束日期</label>
|
||||
<input type="date" name="end" value="{{ end }}">
|
||||
</div>
|
||||
<button type="submit" class="btn-primary">筛选</button>
|
||||
<a href="{{ url_for('plans') }}" style="color:#888;font-size:.85rem;padding:.7rem">重置</a>
|
||||
</form>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
<th>品种</th>
|
||||
<th>方向</th>
|
||||
<th>区间</th>
|
||||
<th>止损</th>
|
||||
<th>止盈</th>
|
||||
<th>状态</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for p in history %}
|
||||
<tr>
|
||||
<td>{{ p.plan_date or '' }}</td>
|
||||
<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.stop_loss }}</td>
|
||||
<td>{{ p.take_profit }}</td>
|
||||
<td>
|
||||
{% if p.status == 'closed' %}<span class="badge profit">已完成</span>
|
||||
{% elif p.status == 'expired' %}<span class="badge expired">已失效</span>
|
||||
{% else %}<span class="badge">{{ p.status }}</span>{% endif %}
|
||||
</td>
|
||||
<td><a href="{{ url_for('del_plan', pid=p.id) }}" class="btn-del" onclick="return confirm('删除?')">删</a></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="8" style="color:#888">暂无历史记录</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
+145
-187
@@ -1,211 +1,166 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}交易记录与复盘 - 国内期货监控系统{% endblock %}
|
||||
{% block content %}
|
||||
<h1 class="page-title">交易复盘记录上传(含截图)</h1>
|
||||
<h1 class="page-title">交易记录与复盘</h1>
|
||||
|
||||
<div class="card">
|
||||
<form action="{{ url_for('add_review') }}" method="post" enctype="multipart/form-data">
|
||||
<div class="form-grid">
|
||||
<div class="field">
|
||||
<label>开仓时间</label>
|
||||
<input type="datetime-local" name="open_time" required>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>平仓时间</label>
|
||||
<input type="datetime-local" name="close_time" required>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>品种</label>
|
||||
<input name="symbol" placeholder="如 ag2608" required>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>周期</label>
|
||||
<input name="timeframe" placeholder="5m" value="5m">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>盈亏(U)</label>
|
||||
<input name="pnl" type="number" step="0.01" placeholder="盈亏金额">
|
||||
</div>
|
||||
<div class="field full">
|
||||
<label>开仓类型(必选)</label>
|
||||
<select name="open_type" required>
|
||||
<option value="">请选择</option>
|
||||
{% for t in open_types %}
|
||||
<option value="{{ t }}">{{ t }}</option>
|
||||
<div class="split-grid">
|
||||
<div class="card">
|
||||
<h2>交易复盘记录上传(含截图)</h2>
|
||||
<div class="card-body card-scroll">
|
||||
<form id="review-form" action="{{ url_for('add_review') }}" method="post" enctype="multipart/form-data">
|
||||
<div class="form-grid">
|
||||
<div class="field"><label>品种</label><input name="symbol" placeholder="ag2608" required></div>
|
||||
<div class="field">
|
||||
<label>方向</label>
|
||||
<select name="direction" required>
|
||||
<option value="">请选择</option>
|
||||
<option value="long">做多</option>
|
||||
<option value="short">做空</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="field"><label>成交价</label><input name="entry_price" type="number" step="0.0001" required></div>
|
||||
<div class="field"><label>止损</label><input name="stop_loss" type="number" step="0.0001" required></div>
|
||||
<div class="field"><label>止盈</label><input name="take_profit" type="number" step="0.0001" required></div>
|
||||
<div class="field"><label>平仓价格</label><input name="close_price" type="number" step="0.0001" required></div>
|
||||
<div class="field"><label>张数</label><input name="lots" type="number" step="1" min="1" value="1" required></div>
|
||||
<div class="field"><label>开仓时间</label><input type="datetime-local" name="open_time" required></div>
|
||||
<div class="field"><label>平仓时间</label><input type="datetime-local" name="close_time" required></div>
|
||||
<div class="field"><label>持仓时长(自动)</label><input id="holding_duration" type="text" readonly class="calc-readonly" placeholder="自动计算"></div>
|
||||
<div class="field"><label>初始盈亏(自动)</label><input id="initial_pnl" type="text" readonly class="calc-readonly" placeholder="按止盈测算"></div>
|
||||
<div class="field"><label>实际盈亏(自动)</label><input id="actual_pnl" type="text" readonly class="calc-readonly" placeholder="按平仓价测算"></div>
|
||||
<div class="field"><label>盈亏金额(手动)</label><input name="pnl" type="number" step="0.01" placeholder="实际盈亏金额"></div>
|
||||
<div class="field"><label>周期</label><input name="timeframe" value="5m"></div>
|
||||
<div class="field full">
|
||||
<label>开仓类型(必选)</label>
|
||||
<select name="open_type" required>
|
||||
<option value="">请选择</option>
|
||||
{% for t in open_types %}<option value="{{ t }}">{{ t }}</option>{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="field"><label>预期 RR</label><input name="expected_rr" type="number" step="0.01"></div>
|
||||
<div class="field"><label>实际 RR</label><input name="actual_rr" type="number" step="0.01"></div>
|
||||
<div class="field">
|
||||
<label>离场触发(必选)</label>
|
||||
<select name="exit_trigger" required>
|
||||
<option value="">请选择</option>
|
||||
{% for t in exit_triggers %}<option value="{{ t }}">{{ t }}</option>{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="field"><label>离场补充</label><input name="exit_supplement" placeholder="手工平仓说明"></div>
|
||||
<div class="field">
|
||||
<label>保本后盯盘</label>
|
||||
<select name="watch_after_breakeven"><option value="否">否</option><option value="是">是</option></select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>占用时新开仓</label>
|
||||
<select name="new_position_while_occupied"><option value="否">否</option><option value="是">是</option></select>
|
||||
</div>
|
||||
<div class="field"><label>截图上传</label><input type="file" name="screenshot" accept="image/*"></div>
|
||||
</div>
|
||||
|
||||
<div class="check-row"><label><input type="checkbox" name="auto_kline" value="1"> 保存时自动生成 K 线图并作为截图</label></div>
|
||||
<div class="form-grid">
|
||||
<div class="field"><label>周期1</label><select name="kline_period1">{% for p in kline_periods %}<option value="{{ p }}" {% if p=='15m' %}selected{% endif %}>{{ p }}</option>{% endfor %}</select></div>
|
||||
<div class="field"><label>周期2</label><select name="kline_period2">{% for p in kline_periods %}<option value="{{ p }}" {% if p=='1h' %}selected{% endif %}>{{ p }}</option>{% endfor %}</select></div>
|
||||
<div class="field"><label>K线数</label><input name="kline_count" type="number" value="300"></div>
|
||||
<div class="field"><label>K线截止</label><select name="kline_cutoff">{% for c in kline_cutoffs %}<option value="{{ c }}">{{ c }}</option>{% endfor %}</select></div>
|
||||
</div>
|
||||
|
||||
<p class="hint">下方勾选行为标签的均为<strong>情绪单</strong></p>
|
||||
<div class="check-row">
|
||||
{% for tag in behavior_tags %}
|
||||
<label><input type="checkbox" name="tag_{{ tag }}" value="1"> {{ tag }}</label>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="field" style="margin-top:.75rem"><label>备注</label><textarea name="notes"></textarea></div>
|
||||
<button type="submit" class="btn-primary" style="margin-top:1rem">保存复盘记录</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>复盘历史</h2>
|
||||
<div class="card-body">
|
||||
<div class="preset-tabs">
|
||||
<a href="{{ url_for('records', preset='today') }}" class="{% if preset=='today' %}active{% endif %}">本日</a>
|
||||
<a href="{{ url_for('records', preset='week') }}" class="{% if preset=='week' %}active{% endif %}">本周</a>
|
||||
<a href="{{ url_for('records', preset='month') }}" class="{% if preset=='month' %}active{% endif %}">本月</a>
|
||||
<a href="{{ url_for('records', preset='custom') }}" class="{% if preset=='custom' %}active{% endif %}">自定义</a>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>预期 RR</label>
|
||||
<input name="expected_rr" type="number" step="0.01" placeholder="预期盈亏比">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>实际 RR</label>
|
||||
<input name="actual_rr" type="number" step="0.01" placeholder="实际盈亏比">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>离场触发(必选)</label>
|
||||
<select name="exit_trigger" required>
|
||||
<option value="">请选择</option>
|
||||
{% for t in exit_triggers %}
|
||||
<option value="{{ t }}">{{ t }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>离场补充(仅手工平仓必填)</label>
|
||||
<input name="exit_supplement" placeholder="手工平仓说明">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>保本后盯盘</label>
|
||||
<select name="watch_after_breakeven">
|
||||
<option value="否">否</option>
|
||||
<option value="是">是</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>占用时新开仓</label>
|
||||
<select name="new_position_while_occupied">
|
||||
<option value="否">否</option>
|
||||
<option value="是">是</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>截图上传</label>
|
||||
<input type="file" name="screenshot" accept="image/*">
|
||||
{% if preset == 'custom' or start or end %}
|
||||
<form method="get" class="filter-row">
|
||||
<input type="hidden" name="preset" value="custom">
|
||||
<div class="field"><label>开始</label><input type="date" name="start" value="{{ start }}"></div>
|
||||
<div class="field"><label>结束</label><input type="date" name="end" value="{{ end }}"></div>
|
||||
<button type="submit" class="btn-primary">筛选</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
<div class="card-scroll">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>平仓</th><th>品种</th><th>方向</th><th>盈亏</th><th>情绪单</th><th>详情</th><th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in reviews %}
|
||||
<tr>
|
||||
<td>{{ r.close_time[:16] if r.close_time else '' }}</td>
|
||||
<td>{{ 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>
|
||||
{% elif r.pnl and r.pnl < 0 %}<span class="badge loss">{{ r.pnl }}</span>
|
||||
{% else %}{{ r.actual_pnl or '-' }}{% endif %}
|
||||
</td>
|
||||
<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 "做空",
|
||||
"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,
|
||||
"holding_duration": r.holding_duration, "initial_pnl": r.initial_pnl,
|
||||
"actual_pnl": r.actual_pnl, "pnl": r.pnl,
|
||||
"open_type": r.open_type, "expected_rr": r.expected_rr, "actual_rr": r.actual_rr,
|
||||
"exit_trigger": r.exit_trigger, "exit_supplement": r.exit_supplement,
|
||||
"is_emotion": r.is_emotion, "behavior_tags": r.behavior_tags,
|
||||
"notes": r.notes, "screenshot": r.screenshot
|
||||
} | tojson }}'>放大查看</button>
|
||||
</td>
|
||||
<td><a href="{{ url_for('del_review', rid=r.id) }}" class="btn-del" onclick="return confirm('删除?')">删</a></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="7" style="color:#888">暂无复盘记录</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="check-row">
|
||||
<label><input type="checkbox" name="auto_kline" value="1"> 保存时自动生成 K 线图并作为截图</label>
|
||||
</div>
|
||||
<div class="form-grid">
|
||||
<div class="field">
|
||||
<label>周期1</label>
|
||||
<select name="kline_period1">
|
||||
{% for p in kline_periods %}
|
||||
<option value="{{ p }}" {% if p == '15m' %}selected{% endif %}>{{ p }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>周期2</label>
|
||||
<select name="kline_period2">
|
||||
{% for p in kline_periods %}
|
||||
<option value="{{ p }}" {% if p == '1h' %}selected{% endif %}>{{ p }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>K线数</label>
|
||||
<input name="kline_count" type="number" value="300" min="50" max="1000">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>K线截止</label>
|
||||
<select name="kline_cutoff">
|
||||
{% for c in kline_cutoffs %}
|
||||
<option value="{{ c }}">{{ c }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<p class="hint">勾选自动生成时,将按所选周期上下排列 K 线图;截止时间为平仓/开仓/当前,用于截取行情片段。</p>
|
||||
|
||||
<div class="check-row">
|
||||
{% for tag in behavior_tags %}
|
||||
<label><input type="checkbox" name="tag_{{ tag }}" value="1"> {{ tag }}</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="field" style="margin-top:1rem">
|
||||
<label>备注</label>
|
||||
<textarea name="notes" placeholder="复盘备注"></textarea>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn-primary" style="margin-top:1rem">保存复盘记录</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>复盘历史</h2>
|
||||
<form method="get" class="filter-row">
|
||||
<div class="field">
|
||||
<label>开始日期</label>
|
||||
<input type="date" name="start" value="{{ start }}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>结束日期</label>
|
||||
<input type="date" name="end" value="{{ end }}">
|
||||
</div>
|
||||
<button type="submit" class="btn-primary">筛选</button>
|
||||
<a href="{{ url_for('records') }}" style="color:#888;font-size:.85rem;padding:.7rem">重置</a>
|
||||
</form>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>开仓</th>
|
||||
<th>平仓</th>
|
||||
<th>品种</th>
|
||||
<th>周期</th>
|
||||
<th>盈亏</th>
|
||||
<th>开仓类型</th>
|
||||
<th>预期RR</th>
|
||||
<th>实际RR</th>
|
||||
<th>离场</th>
|
||||
<th>行为标签</th>
|
||||
<th>截图</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in reviews %}
|
||||
<tr>
|
||||
<td>{{ r.open_time[:16] if r.open_time else '' }}</td>
|
||||
<td>{{ r.close_time[:16] if r.close_time else '' }}</td>
|
||||
<td>{{ r.symbol }}</td>
|
||||
<td>{{ r.timeframe }}</td>
|
||||
<td>
|
||||
{% if r.pnl and r.pnl > 0 %}<span class="badge profit">{{ r.pnl }}</span>
|
||||
{% elif r.pnl and r.pnl < 0 %}<span class="badge loss">{{ r.pnl }}</span>
|
||||
{% else %}{{ r.pnl or '-' }}{% endif %}
|
||||
</td>
|
||||
<td>{{ r.open_type }}</td>
|
||||
<td>{{ r.expected_rr or '-' }}</td>
|
||||
<td>{{ r.actual_rr or '-' }}</td>
|
||||
<td>{{ r.exit_trigger }}</td>
|
||||
<td style="font-size:.8rem">{{ r.behavior_tags or '-' }}</td>
|
||||
<td>
|
||||
{% if r.screenshot %}
|
||||
<a href="{{ url_for('uploaded_file', filename=r.screenshot) }}" target="_blank" style="color:#4cc2ff">查看</a>
|
||||
{% else %}-{% endif %}
|
||||
</td>
|
||||
<td><a href="{{ url_for('del_review', rid=r.id) }}" class="btn-del" onclick="return confirm('删除?')">删</a></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="12" style="color:#888">暂无复盘记录</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="review-modal" class="modal-mask">
|
||||
<div class="modal-box">
|
||||
<span class="modal-close">✕</span>
|
||||
<h3>复盘详情</h3>
|
||||
<div id="review-modal-body"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if auto_records %}
|
||||
<div class="card">
|
||||
<div class="card" style="margin-top:1.5rem">
|
||||
<h2>系统自动记录(止盈/止损)</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>品种</th><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 r in auto_records %}
|
||||
<tr>
|
||||
<td>{{ r.symbol_name or r.symbol }}</td>
|
||||
<td>{{ r.monitor_type }}</td>
|
||||
<td><span class="badge dir">{{ '做多' if r.direction == 'long' else '做空' }}</span></td>
|
||||
<td><span class="badge dir">{{ '多' if r.direction == 'long' else '空' }}</span></td>
|
||||
<td>{{ r.trigger_price }}</td>
|
||||
<td>
|
||||
{% if r.result == '止盈' %}<span class="badge profit">止盈</span>
|
||||
{% else %}<span class="badge loss">止损</span>{% endif %}
|
||||
</td>
|
||||
<td>{% if r.result == '止盈' %}<span class="badge profit">止盈</span>{% else %}<span class="badge loss">止损</span>{% endif %}</td>
|
||||
<td>{{ r.created_at[:16] if r.created_at else '' }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@@ -214,3 +169,6 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block extra_js %}
|
||||
<script src="{{ url_for('static', filename='js/review.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user