Search

EMA

함수설명

지수이동평균(Exponential Average) 지표함수

작성방법

Ema(기준값, 기간)
C
복사

매개변수 설명

"기준값": Numeric, 데이터, 함수, 변수, 계산식 등
"기간": Numeric, 평활계수를 계산할 기간
계산
EP(평활계수) = 2/(기간 + 1) 금일 종가 * EP + 전일의 지수 이동평균 * (1-EP)

활용예시

//인라인함수(수식안에서 만들어 사용하는 함수) Function infx_EMA Numeric { Input : Price(NumericSeries), Length(NumericSimple); Var : EP(0); EP = 2/(Length+1); if index == 0 Then infx_EMA = Price; Else infx_EMA = Price * EP + infx_EMA[1] * (1-EP); } EndFunction input : Period(14); var : emav(0); emav = infx_EMA(C,Period); Plot1(emav);
C
복사
뒤로가기는 좌측상단의 목차 버튼을 눌러주세요.