我在用的MACD副图,新春分享!介绍
我在用的MACD副图,新春分享!
DIFF:EMA(CLOSE,12)-EMA(CLOSE,27);
DEA:EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
{主升浪}
主升 : DIFF>0 AND DIFF>DEA,COLOR0000FF,POINTDOT,LINETHICK0;
FILLRGN(DIFF,DEA,主升,RGB(250,0,0));
DRAWTEXTABS(10,5,'板块名称:'+BKNAME),COLORwhite;
{背景K线}
DRAWGBK(DIFF>DEA,STRIP(rgb(50,0,0),rgb(50,0,0),0));
DRAWGBK(DIFF>0 AND DIFF>DEA,STRIP(rgb(150,30,80),rgb(150,0,0),0));
{背景K线}
DRAWGBK(LAST("MACD.MACD"<REF("MACD.MACD",1)) AND MACD>0,STRIP(rgb(0,0,200),rgb(0,140,0),0));
{MACD分色观察}
STICKLINE(MACD>=0,MACD,0,4,1),COLORF00FF0;
STICKLINE(MACD<0,MACD,0,4,1),COLORWHITE;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,4,0 ),COLOR00aaff;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,3.3,0 ),COLOR00bbff;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,2.2,0 ),COLOR00ccff;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,1.65,0 ),COLOR00ddff;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,1.1,0 ),COLOR00eeff;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,0.55,0 ),COLOR00ffff;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,4 ,0 ),COLOR0000aa;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,3.3 ,0 ),COLOR0011bb;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,2.2,0 ),COLOr0022cc;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,1.65 ,0 ),COLOR0033dd;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,1.1 ,0 ),COLOR0044ee;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,0.55 ,0 ),COLOR0055ff;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,4,0 ),COLOraa00bb;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,3.3 ,0 ),COLORbb11bb;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,2.2,0 ),COLOrcc22bb;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,1.65,0 ),COLORdd33bb;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,1.1,0 ),COLORee44bb;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,0.55 ,0 ),COLORff55bb;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,4,0 ),COLOrffaa00;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,3.3 ,0 ),COLORffbb11;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,2.2,0 ),COLOrffcc22;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,1.65 ,0 ),COLORffdd33;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,1.1 ,0 ),COLORffee44;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,0.55 ,0 ),COLORffff55;
if(diff<0,diff,0),colorred,linethick1;
if(diff<0,0,diff),coloryellow,linethick1;
if(diff<dea,diff,dea),COLOR00ff00,linethick1;
if(diff>dea,dea,dea),COLORwhite,linethick1;
低位金叉:CROSS(DIFF,DEA) AND DIFF<-0.1;
STICKLINE(低位金叉,0,-0.18,6,0),COLORYELLOW;
DRAWTEXT(低位金叉,-0.1,' 低位金叉'),COLORYELLOW;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,-0.18,6,0),ColorFF00FF;
DRAWICON(二次金叉,dea*1.04,13) ;
DRAWTEXT(二次金叉,-0.1,' 二次金叉'),color00ff00;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
STICKLINE(底背离,0,0.13,6,0),Color00FF00;
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,linethick2;
DRAWTEXT(底背离,0.1,' 底背离'),Color00FF00;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,linethick2;
{MACD选股买入信号}
{MACD红柱连续变小后再变长的第一根上涨红柱}
一级买点:"MACD.MACD">REF("MACD.MACD",1) AND REF(LAST("MACD.MACD"<REF("MACD.MACD",1) AND "MACD.MACD">0),1)>=3 ;
STICKLINE(一级买点,0,-0.18,6,0),COLORYELLOW;
DRAWTEXT(一级买点,-0.1,' 一级买点'),ColorFF00FF;
{MACD红柱绿柱,一旦缩短将趋势转向,如缩后再变长,则原趋势更强 ,
条件是前期有一波波段强势上涨,其中30天内有涨停,30天内资金流入大于流出,
回调后,出现买点介入};
{MACD变绿后再变红的第一根红柱}
二级买点:CROSS("MACD.MACD",0) AND REF(COUNT("MACD.MACD"<0,4)<=3,1);
STICKLINE(二级买点,0,-0.18,6,0),ColorFF00FF;
DRAWTEXT(二级买点,-0.1,' 二级买点'),COLORYELLOW;
{MACD变绿后4天内重新再变红出现的第一根红柱是重拾强势之股,
条件是前期有一波波段强势上涨,其中30天内有涨停,30天内资金流入大于流出,
回调后,出现买点介入};
{解盘4}
均价:=(3*C+H+L+O)/6;
VAR1:=(8*均价+7*REF(均价,1)+6*REF(均价,2)+5*REF(均价,3)+
4*REF(均价,4)+3*REF(均价,5)+2*REF(均价,6)+REF(均价,8))/36;
VAR2:=(LLV(VAR1,2)+LLV(VAR1,4)+LLV(VAR1,6))/3;
SZ1:=REF(VAR1,1)=REF(VAR2,1) AND VAR1>VAR2 AND CLOSE>VAR1;
SZ2:=VAR1>VAR2 AND VAR1>REF(VAR1,1) AND VAR2>REF(VAR2,1)
AND H/VAR1<1.1 AND L>VAR2 AND CLOSE>VAR1;
SZ3:=VAR1>VAR2 AND VAR1>REF(VAR1,1) AND VAR2>=REF(VAR2,1) AND H/VAR1>1.1;
SZ4:=VAR1>VAR2 AND VAR1>REF(VAR1,1) AND VAR2>REF(VAR2,1)
AND CLOSE>VAR2 AND CLOSE<VAR1;
SZ5:=(VAR1>VAR2 AND VAR2>REF(VAR2,1) AND VAR1<>REF(VAR1,1)
AND CLOSE<VAR2) OR (VAR1>VAR2 AND VAR1<REF(VAR1,1)
AND VAR2<REF(VAR2,1) AND CLOSE<VAR2);;
SZ6:=REF(VAR1,1)>REF(VAR2,1) AND VAR1=VAR2 AND CLOSE<VAR2;
XD1:=VAR1=VAR2 AND CLOSE<VAR2 OR (VAR1<REF(VAR1,1) AND VAR2<REF(VAR2,1)
AND REF(VAR1,1)=REF(VAR2,1) AND CLOSE<VAR2);
XD2:=VAR1=VAR2 AND CLOSE>VAR1;
IF BARSTATUS=2 AND SZ1 THEN BEGIN
DRAWTEXTABS(800,30,'调整结束短线介入'),LINETHICK7,COLORRED;
END
ELSE
IF BARSTATUS=2 AND SZ2 THEN BEGIN
DRAWTEXTABS(800,30,'上升通道走势良好'),LINETHICK7,COLORRED;
END
ELSE
IF BARSTATUS=2 AND SZ3 THEN BEGIN
DRAWTEXTABS(800,30,'股价偏离注意调整'),LINETHICK7,COLORRED;
END
ELSE
IF BARSTATUS=2 AND SZ4 THEN BEGIN
DRAWTEXTABS(800,30,'上升通道调整洗盘'),LINETHICK7,COLORGREEN;
END
ELSE
IF BARSTATUS=2 AND SZ5 THEN BEGIN
DRAWTEXTABS(800,30,'转向特征注意离场'),LINETHICK7,COLORGREEN;
END
ELSE
IF BARSTATUS=2 AND SZ6 THEN BEGIN
DRAWTEXTABS(800,30,'通道改变坚决离场'),LINETHICK7,COLORGREEN;
END
ELSE
IF BARSTATUS=2 AND XD1 THEN BEGIN
DRAWTEXTABS(800,30,'下跌通道只宜观望'),LINETHICK7,COLORGREEN;
END
ELSE
IF BARSTATUS=2 AND XD2 THEN BEGIN
DRAWTEXTABS(800,30,'短期底部准备进入'),LINETHICK7,COLORYELLOW;
gd25760