Search

MA

함수설명

단순이동평균(Moving Average) 지표함수

작성방법

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

매개변수 설명

"기준값": Numeric, 데이터, 함수, 변수, 계산식 등
"기간": Numeric, 최근 N개봉 기간값을 입력
계산
N기간 기준값의 합/N기간

활용예시

//인라인함수(수식안에서 만들어 사용하는 함수) Function infx_MA Numeric { Input : Price(NumericSeries), Length(NumericSimple); Var : Sum(0), Counter(0); Sum = 0; For Counter = 0 To Length - 1 Begin Sum = Sum + Price[counter]; End; If Length > 0 Then infx_MA = Sum / Length; Else infx_MA = 0; } EndFunction input : Period(14); var : mav(0); mav = infx_MA(C,Period); Plot1(mav);
C
복사
뒤로가기는 좌측상단의 목차 버튼을 눌러주세요.