RemotionUI

Candlestick Chart

OHLC candles printing left to right with a moving average. Install with npx remotion-ui@latest add candlestick-chart.

PrimitiveData & mediaAdvanced

candlestick-chart30fps · 960×540
Install
$ npx remotion-ui@latest add candlestick-chart

A price tape: open-high-low-close candles printing in order, with an optional moving average running behind them.

import { CandlestickChart } from "@/remotion/primitives/candlestick-chart";

<CandlestickChart
  candles={[{ open: 101, high: 106, low: 99, close: 104, label: "W1" }]}
  movingAverage={6}
  staggerInFrames={3.4}
/>

Candles grow from their open

Each candle grows out of its own open price in both directions, not up from the axis. The open is where the period started, so it is the only anchor that leaves a half-drawn candle telling the truth. The wick runs slightly ahead of the body, which is how a real tape prints — the extremes are known before the period closes.

A doji, where open equals close, still gets a minimum body height rather than disappearing.

The average

movingAverage is a simple mean over that many closes, plotted only where a full window exists — a partial window would draw an average of fewer candles than the legend claims. The line trails the candles by a few frames instead of drawing after all of them, so it reads as a running calculation over what is already on screen.

Scale

The value axis is taken from the highs and lows and is not anchored at zero: price charts are read for range, and a zero baseline would flatten a day's movement into a hairline. showLastPrice pins the final close against the right edge in the colour of its own candle.

Candles grow out of their own open in both directions, so a half-drawn candle still tells the truth; the wick runs a little ahead of the body, as a real tape prints. The average is plotted only where a full window exists. The axis is not anchored at zero — price is read for range, and a zero baseline flattens the movement.

Agent notes

Install first, then import the copied source component locally. AI guide →

Import
@/remotion/primitives/candlestick-chart
  • Use when: data stories, metrics, charts, and numeric proof points.
  • Customize: candles, width, height, upColor, plus copied source for timing, layout, colors, and typography.
  • Rule: do not import this component from the remotion-ui npm package; it is copied into your project.

Usage

Example
import { CandlestickChart } from "@/remotion/primitives/candlestick-chart"; <CandlestickChart candles={[{ open: 101, high: 106, low: 99, close: 104, label: "W1" }]} movingAverage={6} staggerInFrames={3.4} />

API Reference

PropTypeDescription
candlesCandle[]`{ open, high, low, close, label? }`, oldest first.
widthnumberDrawing width. Type scales off it.
heightnumberDrawing height.
upColorstringCandles that closed at or above their open.
downColorstringCandles that closed below their open.
movingAveragenumberWindow for the simple moving average. 0 hides the line.
showLastPricebooleanFinal close pinned against the right edge.
showAxisbooleanGridlines and price labels down the left gutter.
durationInFramesnumberLength of one candle's growth.
staggerInFramesnumberFrames between one candle and the next.
exitAtInFramesnumberFrame the tape clears on, oldest first.
framenumberFrame override — pass the parent frame inside a `<Sequence>`.

Related

On this page