Skip to content

PluginReplay

Bar-by-bar replay for candlestick or line series (Stage 2.17 MVP).

Setup

typescript
import { createChart, PluginReplay } from 'velo-plot/trading'

const chart = createChart({ container })
chart.addSeries({ id: 'ohlc', type: 'candlestick', data: ohlc })

await chart.use(PluginReplay({ seriesId: 'ohlc', frameMs: 100 }))
const replay = chart.getPlugin('velo-plot-replay')

Configuration

OptionTypeDefaultDescription
seriesIdstringrequiredSeries to replay
frameMsnumber200Milliseconds between bars during playback

Replay API

typescript
const api = chart.getPlugin('velo-plot-replay')

api.getLength()   // total bars in buffer
api.getIndex()    // current visible bar index
api.seek(10)      // jump to bar index
api.step(1)       // advance N bars
api.play(2)       // auto-play at speed multiplier
api.pause()
api.reset()       // show all bars

During replay, only bars up to the current index are visible. Useful for backtesting visualization and education.

Known limitations

  • Replay steps bar-by-bar; streaming datafeeds should pause live updates during replay.

Released under the MIT License.