飞狐源码:
DIFF :=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA :=EMA(DIFF,5);
MACD :=2*(DIFF-DEA);
DD:=(MACD/2+(DEA*4/6))/(1-2/6);
AA
DD*13*27-27*11*EMA(C,12)+13*25*EMA(C,26))/(2*(27-13));
翻译MT4:
limit=Bars-counted_bars;
for(i=0,y=0;i<limit;i++)
{
if (Time<TimeArray[y]) y++;
EMA1=iMA(NULL,0,12, 0,1,0,i);
EMA2=iMA(NULL,0,26, 0,1,0,i);
DIFF=EMA1-EMA2;
}
limit=MathMin(limit,5000+5);
for(i=0; i<limit; i++)
{
DEA=iMAOnArray(DIFF,Bars,5,0,1,i);
}
limit=MathMin(limit,5000+5);
for(i=0; i<limit; i++)
{
MACD=2*(DIFF-DEA);
DD=(MACD/2+(DEA*4/6))/(1-2/6);
AA=(DD*13*27-27*11**EMA1+13*25*EMA2)/(2*(27-13));
}
问题是翻译之后显示的数值完全不对,相差很大,请高手帮忙看看那出的问题,谢谢
|