View as Markdown

API reference: @salmonui/charts/chart

ChartIndicatorinterface

import type { ChartIndicator } from '@salmonui/charts/chart';
interface ChartIndicator {
    readonly id?: string | undefined;
    readonly kind: 'sma' | 'ema' | 'tma' | 'momentum' | 'rsi' | 'atr' | 'accumulationDistribution' | 'bollinger' | 'macd' | 'stochastic';
    readonly seriesId: string;
    readonly period?: number | undefined;
    readonly field?: 'close' | 'open' | 'high' | 'low' | undefined;
    readonly deviations?: number | undefined;
    readonly fastPeriod?: number | undefined;
    readonly slowPeriod?: number | undefined;
    readonly signalPeriod?: number | undefined;
    readonly kPeriod?: number | undefined;
    readonly dPeriod?: number | undefined;
    readonly display?: 'line' | 'histogram' | 'both' | undefined;
    readonly zones?: boolean | {
        readonly upper?: number | undefined;
        readonly lower?: number | undefined;
    } | undefined;
    readonly yAxis?: string | undefined;
    readonly name?: string | undefined;
    readonly color?: string | undefined;
}

A technical indicator over a series, drawn by the analysis layer.

ChartIndicator members (16)
NameSignatureDescription
idoptionalreadonly id?: string | undefined;
kindreadonly kind: 'sma' | 'ema' | 'tma' | 'momentum' | 'rsi' | 'atr' | 'accumulationDistribution' | 'bollinger' | 'macd' | 'stochastic';
seriesIdreadonly seriesId: string;

The source series (its id, name or yField).

periodoptionalreadonly period?: number | undefined;

Default 14 (Bollinger 20).

fieldoptionalreadonly field?: 'close' | 'open' | 'high' | 'low' | undefined;

Value column of an OHLC series; default 'close' (the y values of other series).

deviationsoptionalreadonly deviations?: number | undefined;

Bollinger band width in standard deviations (default 2).

fastPeriodoptionalreadonly fastPeriod?: number | undefined;
slowPeriodoptionalreadonly slowPeriod?: number | undefined;
signalPeriodoptionalreadonly signalPeriod?: number | undefined;
kPeriodoptionalreadonly kPeriod?: number | undefined;
dPeriodoptionalreadonly dPeriod?: number | undefined;
displayoptionalreadonly display?: 'line' | 'histogram' | 'both' | undefined;

MACD parts (default 'both').

zonesoptionalreadonly zones?: boolean | { readonly upper?: number | undefined; readonly lower?: number | undefined; } | undefined;

RSI and Stochastic overbought / oversold lines and band (default 70 / 30 and 80 / 20).

yAxisoptionalreadonly yAxis?: string | undefined;

Axis for the values: an axes entry, usually in its own pane. Oscillators get a secondary axis otherwise.

nameoptionalreadonly name?: string | undefined;
coloroptionalreadonly color?: string | undefined;

Data color, not a theme token.