Skip to main content

MovingAverageOverlay

type MovingAverageOverlay = {
color?: string | number;
id?: string;
maType: MAKind;
period: number;
source?: MASource;
width?: number;
};

Source: types/src/index.ts:681

A moving-average overlay line drawn on the price pane. Provide an array of these via movingAverages to render a ribbon of SMA/EMA lines.

Properties​

color?​

optional color?: string | number;

Source: types/src/index.ts:694

Line color (hex string or packed ARGB number).


id?​

optional id?: string;

Source: types/src/index.ts:686

Optional stable id, so a host or AI agent can update or remove one line in the ribbon without matching on its settings. Not used by the renderer.


maType​

maType: MAKind;

Source: types/src/index.ts:688

Averaging for this line (MAKind).


period​

period: number;

Source: types/src/index.ts:690

Lookback in candles.


source?​

optional source?: MASource;

Source: types/src/index.ts:692

Price source (MASource). Default 'close'.


width?​

optional width?: number;

Source: types/src/index.ts:696

Stroke width in px. Default 1.5.