Add win/loss metrics to archive stats with symbol filter sync.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -422,6 +422,11 @@
|
||||
if (cur) elExchange.value = cur;
|
||||
}
|
||||
|
||||
function fmtPnlStatOptional(v) {
|
||||
if (v == null || v === "") return "—";
|
||||
return fmtPnlStat(v);
|
||||
}
|
||||
|
||||
function renderStatsRow(label, e, isTotal) {
|
||||
const openN = e.open_count || 0;
|
||||
const sickN = e.sick_count || 0;
|
||||
@@ -435,6 +440,18 @@
|
||||
"</td><td>" +
|
||||
openN +
|
||||
"</td><td>" +
|
||||
(e.win_count || 0) +
|
||||
"</td><td>" +
|
||||
(e.loss_count || 0) +
|
||||
"</td><td>" +
|
||||
fmtPnlStatOptional(e.avg_win) +
|
||||
"</td><td>" +
|
||||
fmtPnlStatOptional(e.avg_loss) +
|
||||
"</td><td>" +
|
||||
fmtPnlStatOptional(e.max_win) +
|
||||
"</td><td>" +
|
||||
fmtPnlStatOptional(e.max_loss) +
|
||||
"</td><td>" +
|
||||
sickN +
|
||||
"</td><td>" +
|
||||
sickShare +
|
||||
@@ -461,6 +478,12 @@
|
||||
sick_pct: st.sick_pct,
|
||||
pnl_total: st.pnl_total,
|
||||
pnl_ex_sick: st.pnl_ex_sick,
|
||||
win_count: st.win_count,
|
||||
loss_count: st.loss_count,
|
||||
avg_win: st.avg_win,
|
||||
avg_loss: st.avg_loss,
|
||||
max_win: st.max_win,
|
||||
max_loss: st.max_loss,
|
||||
},
|
||||
true
|
||||
) +
|
||||
@@ -471,7 +494,7 @@
|
||||
.join("");
|
||||
elStats.innerHTML =
|
||||
'<table class="archive-stats-table"><thead><tr>' +
|
||||
"<th>范围</th><th>开仓</th><th>犯病</th><th>犯病占比</th><th>盈亏</th><th>剔除犯病盈亏</th>" +
|
||||
"<th>范围</th><th>开仓</th><th>盈利单</th><th>亏损单</th><th>平均盈利</th><th>平均亏损</th><th>最大盈利</th><th>最大亏损</th><th>犯病</th><th>犯病占比</th><th>盈亏</th><th>剔除犯病盈亏</th>" +
|
||||
"</tr></thead><tbody>" +
|
||||
rows +
|
||||
"</tbody></table>";
|
||||
|
||||
Reference in New Issue
Block a user