改进版MACD,比原版更容易识别可视化强
注:先设置参数短:最小(2)最大(200)缺省(12)长:最小(2)最大(200)缺省(26)差:最小(2)最大(200)缺省(9){------------------------------------MACD原版------------------------------------}{DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);}{DEA:EMA(DIF,MID);}{MACD:(DIF-DEA)*2,COLORSTICK;}{------------------------------------MACD改版------------------------------------}DIF:EMA(C,短)-EMA(C,长),COLORWHITE; DEA:EMA(DIF,差),COLORYELLOW; MACD:(DIF-DEA)*2,COLORSTICK; 输出0轴:0,DOTLINE; 输出MACD:=MA(MACD,1); 绿柱缩量条件:=输出MACD<0 AND 输出MACD>REF(输出MACD,1);绿柱放量条件:=输出MACD<0 AND 输出MACD<REF(输出MACD,1);红柱缩量条件:=输出MACD>0 AND 输出MACD<REF(输出MACD,1);红柱放量条件:=输出MACD>0 AND 输出MACD>REF(输出MACD,1);STICKLINE(绿柱缩量条件,输出0轴,输出MACD,2,0),COLORRED;STICKLINE(绿柱放量条件,输出0轴,输出MACD,2,0),COLORGREEN;STICKLINE(红柱缩量条件,输出0轴,输出MACD,2,0),COLORCYAN;STICKLINE(红柱放量条件,输出0轴,输出MACD,2,0),COLORMAGENTA;IF(DEA>REF(DEA,1),DEA,DRAWNULL),COLORRED;IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORMAGENTA;金叉CORO:=CROSS(DIF,DEA);DRAWICON(金叉CORO,DIF,1);
{------------------------------------输出------------------------------------};
|