Add daily trend status to product recommendations with breakout priority

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-25 17:25:34 +08:00
parent aba67a3d16
commit 04b6f5e72d
6 changed files with 209 additions and 10 deletions
+12 -4
View File
@@ -121,11 +121,12 @@
保证金优先读取 CTP 柜台合约信息。
{% if recommend_updated_at %}<span class="text-muted">每日后台更新 · 最近 {{ recommend_updated_at }}</span>{% else %}<span class="text-muted" id="rec-updated">等待今日后台刷新…</span>{% endif %}
</p>
<p class="trend-hint">走势说明:拉取近一周日线;最近三天 K 线高低价重叠度 ≥ 70% 判为<strong>震荡</strong>,否则按收盘方向判<strong>多头</strong>/<strong>空头</strong>;前段震荡、近期突破则标为<strong>转多</strong>/<strong>转空</strong>并优先排列。</p>
<div class="trade-table-wrap">
<table class="trade-table">
<thead>
<tr>
<th>品种</th><th>交易所</th><th>参考价</th>
<th>品种</th><th>交易所</th><th>走势</th><th>参考价</th>
<th>参考止损</th><th>参考止盈</th>
<th>1手保证金</th><th>1手手续费</th><th>最大手数</th><th>状态</th>
</tr>
@@ -133,9 +134,16 @@
<tbody id="recommend-list">
{% if recommend_rows %}
{% for r in recommend_rows %}
<tr class="rec-{{ r.status }}">
<td><strong>{{ r.name }}</strong> <span class="text-accent">{{ r.main_code or r.ths }}</span></td>
<tr class="rec-{{ r.status }}{% if r.trend_transition %} rec-trend-break{% endif %}">
<td><strong class="{% if r.trend_transition %}trend-name{% endif %}">{{ r.name }}</strong> <span class="text-accent">{{ r.main_code or r.ths }}</span></td>
<td>{{ r.exchange }}</td>
<td>
{% if r.trend_label and r.trend_label != '—' %}
<span class="badge trend-badge {% if r.trend in ('break_long', 'break_short') %}break{% elif r.trend == 'long' %}profit{% elif r.trend == 'short' %}loss{% else %}planned{% endif %}" title="{% if r.trend_overlap_pct is not none %}近3日重叠 {{ r.trend_overlap_pct }}%{% endif %}">
{% if r.trend_transition %}★ {% endif %}{{ r.trend_label }}
</span>
{% else %}—{% endif %}
</td>
<td>{% if r.price %}{{ r.price }}{% else %}—{% endif %}</td>
<td>{% if r.ref_stop_loss %}{{ r.ref_stop_loss }}{% else %}—{% endif %}</td>
<td>{% if r.ref_take_profit %}{{ r.ref_take_profit }}{% else %}—{% endif %}</td>
@@ -146,7 +154,7 @@
</tr>
{% endfor %}
{% else %}
<tr><td colspan="9" class="empty-hint">等待今日后台刷新推荐…</td></tr>
<tr><td colspan="10" class="empty-hint">等待今日后台刷新推荐…</td></tr>
{% endif %}
</tbody>
</table>