Unify analytics calculations and fail closed on unavailable data

This commit is contained in:
Boki 2026-10-21 19:28:21 -04:00
parent 783b619846
commit ccce401f72
31 changed files with 1978 additions and 1553 deletions

View file

@ -27,7 +27,7 @@ export interface BacktestRunConfiguration {
/** Return, drawdown, and win-rate metrics are fractions (0.10 = 10%). */
export interface BacktestRunMetrics {
totalReturn: number;
sharpeRatio: number;
sharpeRatio: number | null;
maxDrawdown: number;
winRate: number;
/** Completed round trips; trades[] can contain fills or closed trades, identified by kind. */
@ -87,7 +87,7 @@ export interface BacktestRunResult {
drawdownSeries?: { timestamp: number; value: number }[];
dailyReturns?: number[];
monthlyReturns?: Record<string, number>;
riskMetrics?: Record<string, number>;
riskMetrics?: Record<string, number | null>;
};
executionTime: number;
}