Skip to content

@livefolio/sdk / BacktestResult

Type Alias: BacktestResult<S>

BacktestResult<S> = object

Defined in: strategy/run-backtest.ts:102

The return value of runBacktest, containing the full simulation history and the terminal portfolio state.

Type Parameters

Type ParameterDefault type
Sunknown

Properties

bars

bars: ReadonlyMap<AssetId, ReadonlyArray<Bar>>

Defined in: strategy/run-backtest.ts:127

Per-asset bar buffer accumulated by the FeatureRuntime during this run. Empty Map when no featureRuntime was provided in RunBacktestOptions. Used by runLive to seed its streaming FeatureRuntime so indicators with warmup periods (SMA(200), etc.) work on the first live tick.


finalPortfolio

finalPortfolio: Portfolio

Defined in: strategy/run-backtest.ts:113

Portfolio after the last session's fills have been applied. Equivalent to snapshots[snapshots.length - 1].portfolio when there is at least one session, or initialPortfolio when the range is empty.


finalState

finalState: S | undefined

Defined in: strategy/run-backtest.ts:120

Final value of the strategy's auxiliary state after the last build() call. undefined when the strategy is state-less (no initialState() defined). Used by runLive to seed the live runtime so the first live tick continues from the exact state the historical run ended on.


snapshots

snapshots: ReadonlyArray<BacktestSnapshot>

Defined in: strategy/run-backtest.ts:107

Ordered list of snapshots, one per trading session in range. Empty when the calendar has no sessions in the requested range.

Released under the MIT License.