Add daily trend status to product recommendations with breakout priority
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -45,6 +45,10 @@
|
||||
.trade-footer strong{color:var(--accent)}
|
||||
.rec-blocked td{opacity:.55}
|
||||
.rec-ok td:first-child{font-weight:600}
|
||||
.rec-trend-break td:first-child .trend-name{font-weight:700}
|
||||
.trend-badge{font-size:.72rem;white-space:nowrap}
|
||||
.trend-badge.break{color:var(--accent);font-weight:700;border:1px solid var(--accent);background:rgba(56,189,248,.12)}
|
||||
.trend-hint{font-size:.72rem;color:var(--text-muted);margin:.35rem 0 .65rem;line-height:1.5}
|
||||
#positions .card-body.card-scroll{flex:1;max-height:none;overflow-y:auto}
|
||||
.pos-pending-orders{margin-top:.55rem;padding-top:.55rem;border-top:1px dashed var(--table-border)}
|
||||
.pos-pending-orders .pending-title{font-size:.68rem;color:var(--text-muted);margin-bottom:.35rem}
|
||||
|
||||
+20
-3
@@ -979,6 +979,19 @@
|
||||
};
|
||||
}
|
||||
|
||||
function trendBadgeHtml(r) {
|
||||
var label = r.trend_label || '';
|
||||
if (!label || label === '—') return '—';
|
||||
var cls = 'planned';
|
||||
if (r.trend === 'break_long' || r.trend === 'break_short') cls = 'break';
|
||||
else if (r.trend === 'long') cls = 'profit';
|
||||
else if (r.trend === 'short') cls = 'loss';
|
||||
var title = '';
|
||||
if (r.trend_overlap_pct != null) title = ' title="近3日重叠 ' + r.trend_overlap_pct + '%"';
|
||||
var prefix = r.trend_transition ? '★ ' : '';
|
||||
return '<span class="badge trend-badge ' + cls + '"' + title + '>' + prefix + label + '</span>';
|
||||
}
|
||||
|
||||
function renderRecommendations(data) {
|
||||
if (!recommendList || !data) return;
|
||||
updateRecommendMaxMaps(data);
|
||||
@@ -990,14 +1003,18 @@
|
||||
}
|
||||
var rows = data.rows || [];
|
||||
if (!rows.length) {
|
||||
recommendList.innerHTML = '<tr><td colspan="9" class="empty-hint">当前资金下暂无推荐品种(每日后台刷新)</td></tr>';
|
||||
recommendList.innerHTML = '<tr><td colspan="10" class="empty-hint">当前资金下暂无推荐品种(每日后台刷新)</td></tr>';
|
||||
return;
|
||||
}
|
||||
recommendList.innerHTML = rows.map(function (r) {
|
||||
var rowCls = 'rec-' + (r.status || '');
|
||||
if (r.trend_transition) rowCls += ' rec-trend-break';
|
||||
var nameCls = r.trend_transition ? ' class="trend-name"' : '';
|
||||
return (
|
||||
'<tr class="rec-' + (r.status || '') + '">' +
|
||||
'<td><strong>' + (r.name || '') + '</strong> <span class="text-accent">' + (r.main_code || r.ths || '') + '</span></td>' +
|
||||
'<tr class="' + rowCls + '">' +
|
||||
'<td><strong' + nameCls + '>' + (r.name || '') + '</strong> <span class="text-accent">' + (r.main_code || r.ths || '') + '</span></td>' +
|
||||
'<td>' + (r.exchange || '') + '</td>' +
|
||||
'<td>' + trendBadgeHtml(r) + '</td>' +
|
||||
'<td>' + (r.price != null ? r.price : '—') + '</td>' +
|
||||
'<td>' + (r.ref_stop_loss != null ? r.ref_stop_loss : '—') + '</td>' +
|
||||
'<td>' + (r.ref_take_profit != null ? r.ref_take_profit : '—') + '</td>' +
|
||||
|
||||
Reference in New Issue
Block a user