함수설명

Detrend 지표함수

작성방법

Detrend(기준값, 기간)

매개변수 설명

<aside> 📘 계산

AvgVal = 기준값의 N기간 이동평균값 DFact = (N기간*0.5) + 1 Detrend = 기준값 - AvgVal의 Dfact 이전 봉의 값

</aside>

활용예시

//인라인함수(수식안에서 만들어 사용하는 함수)
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,"기준선");

<aside> 💡 뒤로가기는 좌측상단의 목차 버튼을 눌러주세요.

</aside>