From 5c0ba37eda80d39e6ceca59bb1d5f4942f858995 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Thu, 17 Sep 2026 14:32:37 +0800 Subject: chore: establish Strategy Lab source baseline (development, not release) --- frontend/src/pages/ProjectResultsTab.svelte | 299 ++++++++++++++++++++++++++++ 1 file changed, 299 insertions(+) create mode 100644 frontend/src/pages/ProjectResultsTab.svelte (limited to 'frontend/src/pages/ProjectResultsTab.svelte') diff --git a/frontend/src/pages/ProjectResultsTab.svelte b/frontend/src/pages/ProjectResultsTab.svelte new file mode 100644 index 0000000..4149213 --- /dev/null +++ b/frontend/src/pages/ProjectResultsTab.svelte @@ -0,0 +1,299 @@ + + +
+
+

回测结果

+ {#if run} + + Run {run.id.slice(0, 8)}… + {runStatusLabel[run.status]} + + {/if} +
+ + + + {#if !busy && !error && !run} + + {/if} + + {#if run && !busy && !error} + {#if history.length > 1} +
+ + +
+ {/if} + + {#if run.error} + + {/if} + + {#if !result} + + {:else} + {#if result.warnings?.length} + + {/if} + +
+ {#if result.metrics} + {@const mrow = result.metrics} +
+
+
总收益率
+
{fmtPct(mrow.total_return)}
+
+
+
年化收益率
+
{fmtPct(mrow.annual_return)}
+
+
+
最大回撤
+
{fmtPct(mrow.max_drawdown)}
+
+
+
夏普比率
+
{fmtNum(mrow.sharpe)}
+
+
+
平仓回合数
+
{mrow.trade_count ?? "—"}
+
+
+
期末权益
+
{formatMoney(mrow.final_equity)}
+
+
+ {/if} +

+ 平仓回合数为已完成的开仓并全部平仓的完整回合(1 个回合 = 1 次平仓),不含撤单与未平仓的单笔成交;成交记录中的“金额”为真实成交额(数量 × 成交价),非持仓成本。结果非投资建议;未完全模拟流动性/涨跌停等限制。 + 引擎 {result.engine?.name} {result.engine?.version} + {#if result.elapsed_ms} · 耗时 {(result.elapsed_ms / 1000).toFixed(1)}s{/if} + {#if result.peak_rss_kb} · 峰值内存 {fmtNum(result.peak_rss_kb / 1024)} MB{/if} +

+
+ +
+
+ + +
+ {#if chartMode === "equity"} + + {:else} + + {/if} +
+ +
+

订单与持仓记录

+
+
+

成交记录 ({result.trades.length})

+ {#if result.trades.length > 0} +
+ + + + + + + + + + + + + + {#each result.trades.slice(0, 80) as t, i (i)} + + + + + + + + + + {/each} + +
日期标的方向数量价格金额佣金
{t.date}{t.symbol}{t.side === "buy" ? "买入" : "卖出"}{t.quantity}{fmtNum(t.price, 3)}{fmtNum(t.value)}{fmtNum(t.commission, 4)}
+
+ {#if result.trades.length > 80} +

仅显示前 80 条,共 {result.trades.length} 条

+ {/if} + {:else} +

本区间未发生成交

+ {/if} +
+
+

策略日志

+ + {#if logsOpen} +
{result.logs.join("\n")}
+ {/if} +
+
+
+

数据与引擎 + 本轮使用的引擎版本、耗时与消耗内存均在上方备注。 +

+

+ 结果由对应策略代码、配置、数据清单(数据哈希 {result.data_manifest_hash?.slice(0, 12)})以及当时引擎共同决定。 +

+
+
+ {/if} + {/if} + + {#if !busy && !error && history.length === 0 && run === null} + + {/if} +
-- cgit v1.2.3