Skip to content

Documentation / @finchart/indicators / attachMovingAverage

Function: attachMovingAverage()

attachMovingAverage(options): Plugin<SeriesHost, IndicatorApi<MovingAverage>>

Defined in: indicators/src/plugins.ts:196

이동평균을 그 pane에 얹는다.

ts
const ma = plot.mainPane.use(attachMovingAverage({ source: price, period: 20 }));

호스트가 pane인 이유는 시리즈 하나만 얹으면 되기 때문이다 — PaneHost 전체를 받으면 실제로 쓰는 건 addSeries 하나뿐이면서, 얹은 pane이 사라져도 지표가 모른 채 남는 문제가 있었다.

Parameters

options

AttachMovingAverageOptions

Returns

Plugin<SeriesHost, IndicatorApi<MovingAverage>>