A shaded band between two of an indicator's output columns.

interface IndicatorFillSpec {
    between: readonly [string, string];
    colorDown?: string;
    colorDownKey?: string;
    colorUp?: string;
    colorUpKey?: string;
    gradient?:
        | FillGradient
        | (
            ctx: {
                bars: readonly Bar[];
                settings: Readonly<IndicatorSettings>;
                values: IndicatorValues;
            },
        ) => undefined
        | FillGradient;
    opacity?: number;
    overlay?: boolean;
    colorBy(
        ctx: {
            a: null | number;
            b: null | number;
            index: number;
            settings: Readonly<IndicatorSettings>;
            values: IndicatorValues;
        },
    ): undefined
    | string;
    gradientBy(
        ctx: {
            a: null | number;
            b: null | number;
            index: number;
            settings: Readonly<IndicatorSettings>;
            values: IndicatorValues;
        },
    ): undefined
    | FillGradient;
}

Properties

between: readonly [string, string]

Plot keys or unplotted calculated columns; unplotted columns use the band's local scale.

colorDown?: string

Colour where the second is above the first.

colorDownKey?: string
colorUp?: string

Colour where the first plot is above the second.

colorUpKey?: string

Settings keys holding those colours, so the band is restyleable.

gradient?:
    | FillGradient
    | (
        ctx: {
            bars: readonly Bar[];
            settings: Readonly<IndicatorSettings>;
            values: IndicatorValues;
        },
    ) => undefined
    | FillGradient

A price-anchored gradient for the whole band, resolved after each calculation.

opacity?: number

0..1. Defaults to 0.12.

overlay?: boolean

Draw the band on the price pane even though the indicator owns a pane of its own. The pair with IndicatorPlot.overlay: a study can already send one plot to the candles, and a band between two such plots belongs beside them rather than in the study pane the fill would otherwise land in. Ignored for an 'onchart' descriptor, which is on the price pane already.

Methods

  • Per-bar color takes precedence over both gradients and the up/down colors.

    Parameters

    Returns undefined | string