MACD蛇条
优化指标.......红蛇持股,绿蛇持币.......精准抄底,拒绝横盘......红箭金叉,绿箭死叉......................
DIFF : EMA(CLOSE,5) - EMA(CLOSE,26),colorred;
DEA : EMA(DIFF,3),colorgreen;
MACD : 2*(DIFF-DEA), COLORSTICK;
JC := DEA-DIFF;
绿柱面积:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);
红柱面积:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);
本次最低价:=LLV(L,BARSLAST(JC<0));
本次最高价:=HHV(H,BARSLAST(JC>0));
X1:=IF (MACD<0,BARSLAST(CROSS(DIFF,DEA)),0);
前次绿柱面积:=REF(绿柱面积,X1+1);
前次最低价:=REF(本次最低价,X1+1);
Y1:=IF((绿柱面积<0 AND ABS(绿柱面积)<ABS(前次绿柱面积)
AND 本次最低价<前次最低价 ),1,0);
RS1:= MACD<0 AND REF(MACD,1)<0 AND C<前次最低价
AND ABS(绿柱面积)<ABS(前次绿柱面积) AND ABS(MACD)<ABS(REF(MACD,1));
底背驰:= IF (CROSS(DIFF,DEA),REF(Y1,1),0);
DRAWTEXT(底背驰,-0.2,'▲底背'),COLOR00FFFF;
STICKLINE(底背驰,0,-0.01,8,0),COLOR0000FF;
DRAWICON(底背驰,0,23),coloryellow;
DRAWBAND(DIFF,RGB(200,50,55),DEA,RGB(50,100,10));
遵:IF(DIFF>=DEA,DIFF,DRAWNULL),colorred;
守:IF(DEA>=DIFF,DEA,DRAWNULL),COLORFF9900;
纪:IF(DIFF>=DEA,DEA,DRAWNULL),COLOR00FFFF;
律:IF(DEA>=DIFF,DIFF,DRAWNULL),COLOR00FF00;
X2:=IF (MACD>0,BARSLAST(CROSS(DEA,DIFF)),0);
前次红柱面积:=REF(红柱面积,X2+1);
前次最高价:=REF(本次最高价,X2+1);
Y2:=IF((红柱面积>0 AND 红柱面积<前次红柱面积 AND 本次最高价>前次最高价 ),1,0);
RS2:= MACD>0 AND REF(MACD,1)>0 AND C>前次最高价 AND ABS(红柱面积)<ABS(前次红柱面积) AND ABS(MACD)<ABS(REF(MACD,1));
顶背驰:= IF (CROSS(DEA,DIFF),REF(Y2,1),0);
DRAWICON(顶背驰,0,19),colorgreen;
STICKLINE(顶背驰,0,0.01,4,0),COLOR00FF00;
DRAWTEXT(顶背驰,0.5,'▼顶背'),colorlibiue;
买:IFF(底背驰,0.1,0),coloryellow,COLOR0000FF;
卖:IFF(顶背驰,0.1,0),COLOR00FF00;
DRAWICON(CROSS(dea,diff),0.7+0,2);
DRAWICON(CROSS(diff,dea),-0.8-0,1);
VAR1:diff,colorred,LINETHICK2;
上升:IF(VAR1>REF(VAR1,1),VAR1,DRAWNULL),colorred,LINETHICK1;
下降:IF(VAR1<REF(VAR1,1),VAR1,DRAWNULL),colorblue,LINETHICK3;
DRAWTEXT(VAR1>REF(VAR1,1),-1,'▲'),colormagenta;
DRAWTEXT(VAR1<REF(VAR1,1),1,'▼'),colorlicyan;
;
- 上一篇:股魔每日看盘+量比+趋势画线(源码 主图/副图 通达信 贴图 2016/3/31
- 下一篇:主散筹码指标 2016/3/30