网友求助:

老师帮忙改写EMA(DCLOSE,12)飞狐能用

 

解答如下:

TH:=BARSLAST(C<REF(C,1));
TL:=BARSLAST(C>REF(C,1));
HC:=SETVAL(C>=REF(C,1),C,-TH,C);
LC:=SETVAL(C<REF(C,1),C,-TL,C);
DCLOS:=IF(C>=REF(C,1),HC,LC);
EM:EMA(DCLOS,12);