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/ProjectBacktestTab.svelte | 384 +++++++++++++++++++++++++++ 1 file changed, 384 insertions(+) create mode 100644 frontend/src/pages/ProjectBacktestTab.svelte (limited to 'frontend/src/pages/ProjectBacktestTab.svelte') diff --git a/frontend/src/pages/ProjectBacktestTab.svelte b/frontend/src/pages/ProjectBacktestTab.svelte new file mode 100644 index 0000000..baa9e5f --- /dev/null +++ b/frontend/src/pages/ProjectBacktestTab.svelte @@ -0,0 +1,384 @@ + + +
+
+

发起回测

+ + {#if !busyDatasets && datasetsReady.length === 0 && !cfgErr} + + {/if} + {#if datasetsReady.length > 0} +
+ + +
+ + +
+ + +
+ {#if needAck} + + {/if} +
+ + {#if selectedDataset} + 本次回测与该数据集、当前策略快照一同记录,可按原始条件重跑 + {/if} +
+ + {/if} +
+ +
+
+

最近一次回测

+ {#if latest} + + Run 分支 {latest.version_id?.slice(0,8) ?? "—"} + {runStatusLabel[latest.status]} + + {/if} +
+ + {#if latest} + +
+ + + + {#if latest.started_at}{/if} + {#if latest.finished_at}{/if} + + + + +
启动时间{fmtDateTime(latest.created_at)}
开始执行{fmtDateTime(latest.started_at)}
结束时间{fmtDateTime(latest.finished_at)}
代码版本{latest.version_id.slice(0, 10)}
数据集{latest.dataset_id?.slice(0, 8)}…
资金{formatMoney(latest.config.capital)} · 佣金 {fmtPct(latest.config.commission, 4)} · 滑点 {fmtPct(latest.config.slippage, 4)}
+
+ {#if latest.error} + + {/if} + {#if latest.result?.warnings?.length} + + {/if} + {#if latest.status === 'succeeded' && latest.result} + 查看完整结果与图表 + {/if} +
+ {#if canCancel} + + {/if} + {#if canRerun} + + {/if} +
+ {:else} + + {/if} +
+ +
+

回测历史

+ + {#if history && history.length > 0} +
+ + + + + + + + + + + + {#each history as h (h.id)} + + + + + + + + {/each} + +
启动时间状态资金/佣金/滑点数据集结果
{fmtDateTime(h.created_at)}{h.status === 'succeeded' ? '完成' : h.status === 'failed' ? '失败' : h.status === 'running' ? '执行中' : h.status === 'cancelled' ? '已取消' : '排队中'} + {formatMoney(h.config.capital)} · {fmtPct(h.config.commission, 4)} / {fmtPct(h.config.slippage, 4)} + {h.dataset_id?.slice(0, 8)}… + 结果 +
+
+ {/if} +
+
-- cgit v1.2.3