Mark entry/exit on review charts; clarify bars are saved then read.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-21 17:24:24 +08:00
parent 229f0351e0
commit 39bff20d60
3 changed files with 205 additions and 36 deletions
+11 -3
View File
@@ -62,16 +62,24 @@
<div class="card" style="margin-top:14px">
<h3>四周期 K 线(M1 / M5 / M15 / H1)</h3>
<p class="muted">数据来自服务器缓存;由已激活客户端通过 API 上报 bars。无数据时显示占位。</p>
<p class="muted">
K 线由客户端上报后<strong>写入服务器 bars 表保存</strong>;打开复盘时按开/平仓时间窗口<strong>读取</strong>。
蓝线/点=入场,黄线/点=出场,紫虚线=入场→出场。
</p>
<div class="chart-grid" style="margin-top:10px">
{% for tf in ['M1','M5','M15','H1'] %}
<div class="chart-box">
<h4>{{ tf }} · {{ charts[tf]|length }} 根</h4>
{% if charts[tf] %}
<canvas class="chart-canvas" id="chart-{{ tf }}"
data-bars='{{ charts[tf]|tojson }}'></canvas>
data-bars='{{ charts[tf]|tojson }}'
data-open-ts="{{ trade.open_time or '' }}"
data-close-ts="{{ trade.close_time or '' }}"
data-open-price="{{ trade.open_price if trade.open_price is not none else '' }}"
data-close-price="{{ trade.close_price if trade.close_price is not none else '' }}"
data-side="{{ trade.side or '' }}"></canvas>
{% else %}
<div class="empty-chart">暂无 {{ tf }} K 线缓存</div>
<div class="empty-chart">暂无 {{ tf }} K 线(需客户端上报后才有缓存)</div>
{% endif %}
</div>
{% endfor %}