手机端
当前位置:爱约股 > 公式技巧 > MACD公式改写成飞狐的

MACD公式改写成飞狐的

 网友求助:

DIFF :(EMA(CLOSE,12)-EMA(CLOSE,26))*100/EMA(CLOSE,26),COLORWHITE,LINETHICK3;
DEA : EMA(DIFF,9),COLORRED,LINETHICK1;
DIF:IF(DIFF<REF(DIFF,1),DIFF,DRAWNULL),COLORGREEN,LINETHICK3;
ADEA:IF(DEA<REF(DEA,1),DEA,DRAWNULL),COLORGREEN,LINETHICK2;
MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK3;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));

STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,0,0),COLORRED;
STICKLINE(MACD<REF(MACD,1)AND MACD<0,0,MACD,0,0)COLORFFFF00;
STICKLINE(MACD>REF(MACD,1)AND MACD,0,MACD,0,0),COLORFFFF00;
STICKLINE(MACD>REF(MACD,1)AND MACD>0,0,MACD,0,0),COLORRED;

向上:=IF(DIF>=REF(DIF,1),DIF,DRAWNULL),LINETHICK2,COLORRED;
向下:=IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLORGREEN,LINETHICK2;
DRAWICON(CROSS(DIFF,DEA) AND DIFF>REF(DIFF,1) AND DEA<0,DEA,1);
DRAWICON(CROSS(DEA,DIF) AND DIF<REF(DIF,1) AND DEA>0,DEA,2);
 

 

 

解答如下:

DIFF :(EMA(CLOSE,12)-EMA(CLOSE,26))*100/EMA(CLOSE,26),COLORWHITE,LINETHICK3;
DEA : EMA(DIFF,9),COLORRED,LINETHICK1;
DIF:PARTLINE(DIFF<REF(DIFF,1),DIFF),COLORGREEN,LINETHICK3;
ADEA:PARTLINE(DEA<REF(DEA,1),DEA),COLORGREEN,LINETHICK2;
MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK3;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));

STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,0,0),COLORRED;
STICKLINE(MACD<REF(MACD,1)AND MACD<0,0,MACD,0,0)COLORFFFF00;
STICKLINE(MACD>REF(MACD,1)AND MACD,0,MACD,0,0),COLORFFFF00;
STICKLINE(MACD>REF(MACD,1)AND MACD>0,0,MACD,0,0),COLORRED;
DRAWICON(CROSS(DIFF,DEA) AND DIFF>REF(DIFF,1) AND DEA<0,DEA,1);
 

分享至:

相关推荐