Skip to content

LayerConfig

Layers are added to panel. To be a added to the same panel, layers must have the same scale.

For indicator-specific period naming, prefer each layer's dedicated API (fastPeriod for MACD, kPeriod for Stochastic). See each layer config page for details and legacy aliases.

Examples

Minimal candlesticks layer - as component

tsx
<Candlesticks/> // used in <Panel>

Minimal candlesticks layer - as configuration object

ts
{
  type: 'price:candlesticks'
}

Simple moving average indicator - as component

tsx
<SMA // used in <Panel>
  id='my-moving-average-layer'
  type='sma'
  period={50}
  valueLine={{
    color: 'orange'
  }}
/>

Simple moving average indicator - as configuration object

ts
{
  id: 'my-moving-average-layer',
  type: 'sma',
  period: 50,
  valueLine: {
    color: 'orange'
  }
}

Specific Layers

TypeScript

LayerConfig

ts
type LayerConfig =
  CandlestickLayerConfig
  | PriceLineLayerConfig
  | VolumeBarsLayerConfig
  | IndicatorLayerConfig;

IndicatorLayerConfig

ts
type IndicatorLayerConfig =
  SmaLayerConfig
  | EmaLayerConfig
  | BollingerBandsLayerConfig
  | RsiLayerConfig
  | StochasticLayerConfig
  | MacdLayerConfig
  | AtrLayerConfig;

React Candlesticks is available on npm and GitHub under the MIT License.