interface ReplayOptions {
    autoStart?: boolean;
    barMs?: number;
    bars?: readonly Bar[];
    now?: () => number;
    onFrame?: (state: ReplayState) => void;
    scheduler?: ReplayScheduler;
    series?: SeriesApi | readonly SeriesApi[];
    simulate?: ReplaySimulation;
    speed?: number;
    startIndex?: number;
    startTime?: number;
    subBars?: readonly Bar[];
    timing?: ReplayTiming;
}

Properties

autoStart?: boolean

False prepares and validates the snapshot without changing the chart. Default true.

barMs?: number

Wall-clock milliseconds per bar at speed 1. Default 1000.

bars?: readonly Bar[]

The full session. Defaults to the primary series' current data. Never mutated, and never handed to the chart as-is: each frame gets its own slice.

now?: () => number

Playback clock. Default performance.now.

onFrame?: (state: ReplayState) => void

Called on every playhead move, after the chart has been updated.

scheduler?: ReplayScheduler

Playback timer. Default setInterval, with the interval held from 1 ms to 2^31 - 1 ms, the longest a platform timer waits (a longer one fires at once).

series?: SeriesApi | readonly SeriesApi[]

The series replay drives. The first one owns the timeline; any others (a volume histogram, a comparison line) are truncated to the same instant by time, because the shared DataLayer merges every series onto one axis and a series left at full length would drag future timestamps back onto it.

Optional only if the host chart implements primarySeries().

simulate?: ReplaySimulation

Form a displayed bar that no finer bar covers over simulated steps instead of landing it whole: the 5-minute bars older than the 1-minute history a feed keeps, or every bar when there is no finer feed at all. The path runs from the open to the nearer extreme, the other extreme and the close, held inside the bar like every forming bar (see subBars), and closes on the bar itself. Real finer bars always win where they exist. ReplayState.simulated says which steps are simulated. Off by default, so a bar without finer data takes one step as before.

speed?: number

Initial speed multiplier. Default 1.

startIndex?: number

Bar to open at (0-based). Default 0.

startTime?: number

Initial UTC availability time. Requires timing; otherwise startIndex selects a completed candle.

subBars?: readonly Bar[]

Finer-grained bars the displayed ones are built from: the 1-minute session under a 5-minute chart. Given these, the playhead advances a sub-bar at a time and the newest bar forms in front of the user the way a live one does, instead of appearing complete. A 5-minute bar over 1-minute data takes five steps.

They must cover the same session as bars and be sorted by time; sub-bars outside any displayed bucket are ignored. The last step of a bucket emits the displayed bar verbatim rather than the aggregate, so a bucket always closes on exactly the number the chart would have shown without this option, whatever the two feeds disagree about in between. Every step before it is held inside that bar, the way a live candle grows: the displayed bar's open from the first step, the finer extremes and close within its high and low, and volume no more than its volume. A forming bar never shows a price its closed bar denies.

Only the first driven series forms partially. Followers are cut to completed buckets, because the controller cannot know how to half-aggregate an arbitrary one: a volume histogram is summed, not OHLC-merged. The partial bar reaches the host as ReplayState.bar on every frame, so a host that wants a growing volume bar writes it from there.

timing?: ReplayTiming

Explicit candle availability for time-aligned replay. Omitted preserves index-based replay.