[MT4指标]请教如何将《精明交易者》中提到的自适应移动平均值指标编入MT
以下是书中写好的Omega的指标编程
inputs:perod(10);
vars:noise(0),signal(0),diff(0),efratio(0),smooth(1),fastend(0.666),slowend(0.0645),AMA(0);
{CALCULATE EFFICIENCY RATIO}
diff=@AbsValue(close-close[1]);
if(currentbar<=period) then AMA=close;
if(currentbar>period) then begin
signal=@AbsValue(close-close[period]);
noise=@Summation(diff,period);
efratio=signal/noise;
smooth=@Power(efratio*(fastend-slowend)+slowend,2);
{ADAPTIVE MOVING AVERAGE}
AMA=AMA[1]+SMOOTH*(close-AMA[1]);
Plot1(AMA,"AMA");
end;