36 lines
2 KiB
TypeScript
36 lines
2 KiB
TypeScript
import { BacktestRunner } from '../../apps/stock/orchestrator/src/backtest/BacktestRunner';
|
|
import type {
|
|
BacktestExecutionEngine,
|
|
LegacyBacktestExecutionEngine,
|
|
} from '../../apps/stock/orchestrator/src/backtest/execution-engine';
|
|
import type { BacktestRunRepository } from '../../apps/stock/orchestrator/src/backtest/run-repository';
|
|
import { RustBacktestAdapter } from '../../apps/stock/orchestrator/src/backtest/RustBacktestAdapter';
|
|
|
|
function canonicalDependencies(
|
|
engine: BacktestExecutionEngine,
|
|
legacy: LegacyBacktestExecutionEngine,
|
|
repository: BacktestRunRepository,
|
|
withoutReplay: Omit<BacktestExecutionEngine, 'runCanonical'>,
|
|
withoutClaim: Omit<BacktestRunRepository, 'startCanonical'>,
|
|
withoutDataset: Omit<BacktestRunRepository, 'loadCanonicalDataset'>,
|
|
withoutCompletion: Omit<BacktestRunRepository, 'completeCanonical'>
|
|
) {
|
|
const logger = { error() {} };
|
|
new BacktestRunner({ engine, repository, logger });
|
|
// @ts-expect-error Canonical replay is mandatory; a legacy playback engine is insufficient.
|
|
new BacktestRunner({ engine: legacy, repository, logger });
|
|
// @ts-expect-error The current runner cannot be composed without canonical execution.
|
|
new BacktestRunner({ engine: withoutReplay, repository, logger });
|
|
// @ts-expect-error Canonical claim custody is mandatory.
|
|
new BacktestRunner({ engine, repository: withoutClaim, logger });
|
|
// @ts-expect-error Retained canonical dataset loading is mandatory.
|
|
new BacktestRunner({ engine, repository: withoutDataset, logger });
|
|
// @ts-expect-error Canonical completion persistence is mandatory.
|
|
new BacktestRunner({ engine, repository: withoutCompletion, logger });
|
|
// @ts-expect-error Current execution does not accept provider storage dependencies.
|
|
new RustBacktestAdapter({ logger, storage: { getHistoricalBars: async () => [] } });
|
|
// @ts-expect-error The canonical runner cannot select a competing engine by name.
|
|
new BacktestRunner({ engine, repository, logger, engineName: 'typescript' });
|
|
}
|
|
|
|
void canonicalDependencies;
|