Interface IndicatorAlertSpec

A condition the runtime watches, declared by the descriptor rather than wired up by the host: the indicator is the only thing that knows what a crossover of its own columns means.

Evaluated once per bar, for bars that are new since the last evaluation, so adding the indicator to a loaded chart fires nothing for history.

interface IndicatorAlertSpec {
    frequency?: IndicatorAlertFrequency;
    id: string;
    message?: string | (ctx: IndicatorAlertContext) => string;
    title: string;
    when(ctx: IndicatorAlertContext): boolean;
}

Properties

Methods

Properties

Omitted retains evaluation only when a new bar is appended. Explicit policies also observe qualifying updates within a bar. once is spent only by a delivered live event and lasts for this instance's lifetime. Historical loads, replay and settings-only recalculation never deliver.

id: string

Stable within the descriptor, e.g. 'cross-up'.

message?: string | (ctx: IndicatorAlertContext) => string

Longer text for a notification; defaults to title. A function is handed the same context when judged, so the message can carry the bar's own numbers: the price it crossed at, the histogram reading, a JSON body for a webhook. It runs only for a bar when accepted.

title: string

Short human label, e.g. 'MACD crossed up'.

Methods