One plotted line/band/histogram. type is any registered chart type.

interface IndicatorPlot {
    colorKey?: string;
    key: string;
    offset?: number;
    ohlc?: { close: string; high: string; low: string; open: string };
    overlay?: boolean;
    priceFormat?: PriceFormat;
    priceScaleId?: PriceScaleId;
    style?: SeriesStyle;
    title: string;
    type: SeriesType;
    colorBy(
        ctx: {
            index: number;
            settings: IndicatorSettings;
            value: number;
            values: IndicatorValues;
        },
    ): undefined
    | string;
    colorParts(
        ctx: {
            index: number;
            settings: IndicatorSettings;
            value: number;
            values: IndicatorValues;
        },
    ): undefined
    | PlotBarColor;
}

Properties

colorKey?: string

Settings key holding this plot's color, so a settings change restyles the series without a full rebuild.

key: string

Key into the calc result.

offset?: number

Draw the column shifted this many bars to the right (negative: left). The column itself stays one value per bar and calc returns exactly what it always did; only where each value is painted moves. Positive is what a displaced cloud or a projected channel wants: the last offset values land in the right margin, past the newest candle, where no bar exists to hold them. It shifts the drawn series only. A fill between two plots with the same offset follows; the legend reads the value drawn under the cursor.

ohlc?: { close: string; high: string; low: string; open: string }

Four calc keys to draw this plot as bar-shaped elements instead of one value per bar: candles, hollow candles, OHLC bars, high-low.

A single column cannot express those at all, and the alternative (a second result shape for calc) would fork the contract every descriptor and every helper is written against. Naming four columns inside the same IndicatorValues keeps one shape: a smoothed Heikin-Ashi overlay, a higher-timeframe candle, a synthetic spread instrument each return four ordinary columns and point at them from here.

The named columns must all exist and be bar-aligned, or addIndicator throws. key stays the series identity and the legend reading falls back to the close column.

overlay?: boolean

Draw this one plot on the price pane even though the indicator owns a pane of its own. An oscillator that also wants a signal band or a stop line sitting on the candles is the case: the study belongs in its own pane, one of its columns belongs on price, and splitting it into two indicators would make the user configure the same inputs twice.

Ignored for an 'onchart' descriptor, which is already on the price pane.

priceFormat?: PriceFormat

Value formatting for the axis and crosshair tag of the scale this plot maps to: percent for a ratio study, volume for a cumulative one, custom for anything else.

Like style.precision, this is a property of the price scale, not of the series, so it belongs to a plot that owns its pane. Setting it on an 'onchart' plot reformats the instrument's own axis, which is almost never what a study wants.

percent suffixes the value as it stands and does not scale it, so a study returning a 0..1 fraction should keep returning it and read 0.62%. Scaling inside calc to make the axis read better changes the plotted value, and the legend, the crosshair and every downstream calculation with it.

priceScaleId?: PriceScaleId

Price axis for this plot. Defaults to 'right'.

style?: SeriesStyle

Style overrides merged onto the chart type's defaults.

title: string

Legend title.

Registered chart type used to draw it ('line', 'histogram', 'area', ...).

Methods

  • Per-bar colour, for plots whose meaning changes bar to bar: a MACD histogram is four colours by sign and direction, a conditional study two. Return undefined to fall back to the plot's own colour.

    Reaches the renderer as Bar.color, so every Family-A plot type honours it: histogram, column, candles, OHLC bars, line, step and area.

    Parameters

    Returns undefined | string

  • Per-bar colour split three ways, for a candle plot whose wick or border should not follow its body: a solid wick over a translucent body, a border in the trend colour. Takes precedence over colorBy for the parts it names; a part it leaves undefined falls back to colorBy, then to the plot's own colour. A value plot (line, histogram, column) reads body only.

    Parameters

    Returns undefined | PlotBarColor