股票论坛

标题: macd变色龙 [打印本页]

作者: 冬日阳光    时间: 2017-2-16 17:14
标题: macd变色龙
LONG (2, 100, 26); SHORT (1, 40, 12); M (1, 60, 9);

DIF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA : EMA(DIF,M);
MACD : 2*(DIF-DEA),COLORSTICK;
STICKLINE(MACD>0 AND MACD>=REF(MACD,1),0,MACD,6,0),colorRED;
STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,6,0),colorYELLOW;
STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,6,0),colorGREEN;
STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,6,0),colorBLUE;


A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
底背离:REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA),,LINETHICK0;
低位金叉:CROSS(DIF,DEA) AND DIF<-0.1,linethick0;
二次金叉:CROSS(DIF,DEA) AND DEA<0,COLORRED,LINETHICK0;
双金叉:低位金叉 AND 二次金叉,ColorYellow,LINETHICK0;
双金叉标志:=IF(低位金叉 AND 二次金叉,1 ,0 );
三全项: 双金叉标志=1 AND 底背离,ColorYellow,LINETHICK0;
三全项标志:=IF(双金叉标志=1 AND 底背离,1 ,0 );

STICKLINE(低位金叉,0,0.08,6,0),COLORFF00FF;
DRAWTEXT(低位金叉 AND 双金叉标志=0,MACD,'低位金叉',macd-10),COLORWHITE;
JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));

STICKLINE(二次金叉,0,0.06,6,0),COLORFFCC00;
DRAWICON(二次金叉,DEA*0.9,1);
DRAWTEXT(二次金叉 AND 双金叉标志=0,MACD,'二次金叉',macd-25),COLORYELLOW;

DRAWTEXT(双金叉 AND 三全项标志=0,MACD,'双金叉',macd-25),COLORYELLOW;

STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;
DRAWTEXT(底背离,MACD,'底背离',20),COLORFF00FF;

DRAWTEXT(三全项标志=1,MACD,'三全项',macd-40),COLOR0000FF,LINETHICK2;

DRAWTEXT(顶背离,REF(DEA,A2)*1.18,' 顶背离'),colorgreen;







欢迎光临 股票论坛 (http://100000w.com/) Powered by Discuz! X3.2