Skip to content

Documentation / @finchart/indicators / movingAverage

Function: movingAverage()

Call Signature

movingAverage(source, options): MovingAverage

Defined in: indicators/src/factories.ts:72

이동평균 — 단순(기본)·지수. 갈래는 ma 하나뿐이지만 계산 노드인 이유는 다른 지표의 입력(Source)이 될 수 있어서다.

ts
const ma20 = movingAverage(price, { period: 20 });
const ema20 = movingAverage(price, { period: 20, type: "ema" });
pane.addSeries({ series: lineSeries(), input: ma20.out.ma });

Parameters

source

Source<OHLC>

options

MovingAverageOptions

Returns

MovingAverage

Call Signature

movingAverage<T>(source, options): MovingAverage

Defined in: indicators/src/factories.ts:76

이동평균 — 단순(기본)·지수. 갈래는 ma 하나뿐이지만 계산 노드인 이유는 다른 지표의 입력(Source)이 될 수 있어서다.

ts
const ma20 = movingAverage(price, { period: 20 });
const ema20 = movingAverage(price, { period: 20, type: "ema" });
pane.addSeries({ series: lineSeries(), input: ma20.out.ma });

Type Parameters

T

T extends BaseDataPoint

Parameters

source

Source<T>

options

MovingAverageOptions & object

Returns

MovingAverage