Indicators
Indicators are props. Name the ones you want and the chart calculates and draws them, and keeps them up to date as live prices arrive. Tick some below.
Try them
<AstroneumChart
symbol={symbol}
period={period}
datafeed={datafeed}
mainIndicators={[{ name: 'EMA', calcParams: [7, 25, 99] }, { name: 'BOLL' }]}
subIndicators={['VOL', 'RSI']}
/>Watch the code under the chart: it is the exact props for what is on screen. Adding or removing a name updates the chart in place; nothing remounts.
On the price chart, or in a pane
An indicator measured in prices (a moving average, Bollinger Bands) belongs on the price chart, so it goes in mainIndicators. One with its own scale (RSI, MACD, volume) gets its own pane, so it goes in subIndicators, one pane each.
Settings and changing them later
Pass calcParams to change an indicator's settings; leave it out for the defaults.
<AstroneumChart
mainIndicators={[
{ name: 'EMA', calcParams: [7, 25, 99] }, // three moving averages
{ name: 'BOLL', calcParams: [20, 2] }, // period 20, 2 standard deviations
]}
subIndicators={['RSI', 'MACD']} // default settings
/>The lists follow your state, so you can add and remove indicators while the chart is running:
const [indicators, setIndicators] = useState(['VOL'])
// add 'RSI' later: the chart gains a pane, without remounting
<button onClick={() => setIndicators(list => [...list, 'RSI'])}>Add RSI</button>
<AstroneumChart subIndicators={indicators} /* ... */ />What is available
About 50 indicators are built in. This is the list the live demo's picker offers; those marked price chart are overlays, and the rest get a pane.
| Category | Indicators |
|---|---|
| Moving Averages | SMA ◆ EMA ◆ DEMA ◆ TEMA ◆ WMA ◆ VWMA ◆ AMA ◆ HMA ◆ |
| Trend | MACD DMI ADX SAR ◆ TRIX Ichimoku ◆ KC ◆ |
| Momentum | RSI KDJ CCI MTM ROC %R AO |
| Volatility | BOLL ◆ ATR HV DC ◆ STDDEV |
| Volume | VOL OBV PVT CMF MFI A/D VROC VR |
| Oscillators | BRAR BBI ◆ PSY BIAS EMV DMA CR |
| Market Profile | VWAP ◆ PP ◆ |
| Advanced | SuperTrend ◆ ZZ ◆ |
| Statistical | CORR LinReg ◆ |
◆ drawn on the price chart (mainIndicators). Hover a name for its description.
Your own indicators
The built-in list is not a limit. Register your own with registerIndicatorPlugin (a function from bars to numbers, with optional drawing), or write one in the in-chart script editor. The plugin guide walks through both. For very long histories, see Speed and offline.