함수설명
Detrend 지표함수
작성방법
Detrend(기준값, 기간)
C
복사
매개변수 설명
•
"기준값": Numeric, 데이터, 함수, 변수, 계산식 등
•
"기간": Numeric, 최근 N개봉 기간값을 입력
계산
AvgVal = 기준값의 N기간 이동평균값
DFact = (N기간*0.5) + 1
Detrend = 기준값 - AvgVal의 Dfact 이전 봉의 값
활용예시
//인라인함수(수식안에서 만들어 사용하는 함수)
Function Infx_DPO Numeric
{
Inputs : Price(NumericSeries), Length(NumericSimple);
Var : AvgVal(0), DFact(0);
AvgVal = Ma(Price, Length);
DFact = (Length * 0.5) + 1;
If CurrentBar > DFact Then
Infx_DPO = Price - AvgVal[DFact];
Else
Infx_DPO = 0;
}
EndFunction
input : Period(10);
var : DPO(0);
DPO = Infx_DPO(C,Period);
Plot1(DPO);
PlotBaseLine1(0,"기준선");
C
복사
뒤로가기는 좌측상단의 목차 버튼을 눌러주세요.