feat(portfolio): 组合回测结果增强: 基准对比曲线(对齐交易日+归一化)+回撤序列+扩展指标(波动/Sortino/Calmar/超额/Alpha/Beta), worker与API透传, 结果页净值对比+回撤图 [vps]
CI/CD / test (push) Successful in 15s
CI/CD / nas-deploy (push) Failing after 13s
CI/CD / nas-verify (push) Has been skipped

This commit is contained in:
2026-08-13 18:22:10 +08:00
parent c41fd862ea
commit 08aec403f7
6 changed files with 291 additions and 10 deletions
+20
View File
@@ -51,6 +51,24 @@ export interface PortfolioMetrics {
win_rate_daily: number | null
win_rate_trade: number | null
trading_days: number | null
// 扩展指标(后端 _compute_extended_metrics,可能缺失)
annual_volatility?: number | null
sortino?: number | null
calmar?: number | null
benchmark_return?: number | null
excess_return?: number | null
alpha?: number | null
beta?: number | null
}
export interface BenchmarkPoint {
date: string
benchmark: number
}
export interface DrawdownPoint {
date: string
drawdown: number
}
export interface PortfolioBacktestResult {
@@ -60,6 +78,8 @@ export interface PortfolioBacktestResult {
trades: PortfolioTrade[]
equity_curve: EquityPoint[]
metrics: PortfolioMetrics
benchmark_curve?: BenchmarkPoint[]
drawdown_curve?: DrawdownPoint[]
raw_summary?: Record<string, unknown>
}