Indicators
How indicators compute, how they render (overlay vs pane), and how to add or remove them at runtime.
An indicator is a pure function over ReadonlyArray<Bar> that
returns one or more output series. ChartForge ships 30+ indicators
in @elitechart/indicators; you can write your own following the
same shape.
Quick example
How it works
Indicators run in a topological pipeline. Each one declares its inputs (a series — close, hlc3, etc.) and its outputs (one or more series). The pipeline:
- Collects active indicators from
useChartStore.indicators. - Sorts them by dependency order (RSI on top of EMA depends on the EMA result).
- Calls each indicator's
compute(bars, params)function. - Hands the resulting series back to the renderer, which paints them either as an overlay on the price pane or in a separate pane below the price.
The compute function is pure. The same (bars, params) always
returns the same result — which makes indicators deterministic,
backtestable, and worker-portable when we ship Workers.
Overlay vs pane
The indicator's paneKind field decides where it renders.
'overlay'— drawn on the same pane as the price (EMA, SMA, Bollinger Bands, VWAP).'pane'— drawn in a separate pane below the price (RSI, MACD, Stochastic, OBV).
Pane indicators stack vertically. Each pane has its own price axis and crosshair readout.
Variations
Remove an indicator
Update parameters at runtime
Subpath imports for tree-shaking
Only the indicators you actually use should reach your bundle:
API
| Symbol | From | Notes |
|---|---|---|
IndicatorPlugin | @elitechart/core | the contract |
useChartStore.addIndicator | @elitechart/elitechart | mutate the active set |
useChartStore.removeIndicator | – | – |
useChartStore.patchIndicator | – | patch params |
Related
- Indicators catalog — the full 30+ list
- Writing an indicator
- Series