DRAWGBK(C>0, RGB(0,10,10),RGB(88,0,0),0,'0',0);
DIFF8 := EMA(CLOSE,M) - EMA(CLOSE,N),POINTDOT,LINETHICK1;
DEA8 := EMA(DIFF8,N1),POINTDOT,LINETHICK1;
MACD8 := 2*(DIFF8-DEA8), COLORSTICK;
STICKLINE(DIFF8>=DEA8,DIFF8,DEA8,4,0), COLORFF99FF;
STICKLINE(DIFF8<DEA8,DIFF8,DEA8,4,0)COLORBLUE;
STICKLINE(DIFF8<REF(DIFF8,1) AND MACD8>0,DIFF8,DEA8,4,0), COLOR99CC32;
DRAWICON(CROSS(DEA8,DIFF8),DEA8,3);
DRAWICON(CROSS(DIFF8,DEA8),DEA8,1);
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),LINETHICK0;
W1:STICKLINE(MACD>0,MACD,0,3,1),COLORRED;
W2:STICKLINE(MACD<0,MACD,0,3,1),COLORCYAN;
VA1:=HHVBARS(MACD,BARSLAST(MACD<0)+1);
VA2:=CROSS(BACKSET(CROSS(0,MACD),REF(VA1,1)+2),0.5);
QG:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR AND MACD>0),REF(VA1,1)+2),0.5);
前高:DRAWLINE(VA2,MACD,REF(VA2,1),REF(MACD,1),1),COLORMAGENTA;
VA3:=LLVBARS(MACD,BARSLAST(MACD>0)+1);
VA4:=CROSS(BACKSET(CROSS(MACD,0),REF(VA3,1)+2),0.5);
BD:=BARSLAST(FILTERX(CROSS(0,MACD),BARSCOUNT(C)));
前低:DRAWLINE(VA4,MACD,REF(VA4,1),REF(MACD,1),1);
BDTJ:=IF(MACD<0,FILTERX(MACD=LLV(MACD,BARSLAST(MACD>0)),
BARSCOUNT(C)),DRAWNULL);
TSBDTJ:=BARSLAST(BDTJ);
BDZH:=FILTERX(MACD<CONST(LLV(MACD,BD+1)),BARSCOUNT(C));
BDTS:=BARSLAST(BDZH);
本低:IF(BD+1>=1,CONST(LLV(MACD,BD+1)),DRAWNULL);
BDCL:=CROSS(COUNT(CROSS(MACD>本低/2 AND MACD<0,0.5),TSBDTJ)=1,0.5) AND TSBDTJ>=0;
終點:=IF(ISLASTBAR AND MACD>0 AND MACD=HHV(MACD,BARSLAST(MACD<0)),1,
IF(FILTERX(QG,BARSCOUNT(C)),2,DRAWNULL));
UU:=(終點=1 OR 終點=2) AND MACD>0;
ZZ:=FILTERX(UU,BARSCOUNT(C));
本高:DRAWLINE(ZZ,MACD,REF(ZZ,1),REF(MACD,1),1),COLORWHITE;
橫線:=CONST(REF(MACD,BARSLAST(ZZ)));
WW:=MACD>橫線;
起始點:=FILTERX(REFX(BARSLAST(WW),1)=1,BARSCOUNT(C));
天數(shù):BARSLAST(起始點),COLORYELLOW,NODRAW;
上橫線:DRAWLINE(起始點,橫線,ZZ,橫線,0),COLORGREEN,DOTLINE;
下橫線:DRAWLINE(BDZH,CONST(LLV(MACD,BD+1)),BDTJ=1,MACD,0),COLOR8080FF,DOTLINE;
DRAWNUMBER(BDTJ,CONST(LLV(MACD,BD+1))*0.9,BDTS);
DRAWNUMBER(ZZ,上橫線*1.1,天數(shù));
TJ:=IF(起始點,BARSNEXT(ZZ),DRAWNULL);
紅柱數(shù)量:IF(天數(shù)>0 AND 天數(shù)<=REF(TJ,天數(shù)),SUM(MACD>0,天數(shù)),DRAWNULL),COLORWHITE,NODRAW;
橫線起始價:REF(C,天數(shù)),NODRAW;
空間評估:(橫線起始價-C)/C*100,NODRAW;
TT:=BARSLAST(ZZ);
WQG:=CROSS(COUNT(CROSS(MACD<本高/2 AND MACD>0,0.5),ZZ)=1,0.5) AND ZZ>=0;
STICKLINE(MACD>前高 AND 本高>前高 AND BARSLAST(CROSS(MACD<本高/2,0.5))>0 AND
MACD>(前高+本高)/2,MACD,前高,1,0),COLORYELLOW;
前高本高二分位:IF(MACD>0 AND 本高!=前高,DRAWLINE(WQG,(前高+本高)/2,REF(WQG,1),REF((前高+本高)/2,1),1)
,DRAWNULL),COLORC0C000,DOTLINE;
AA:=STRCAT(STRCAT(STRCAT('〖','上升空間'),'〗'),CON2STR(IF(空間評估,空間評估,
DRAWNULL),2));
DRAWTEXT(WQG,MACD*1.1,'本高成立'),COLORWHITE;
DRAWTEXT(BDCL,MACD*1.1,'本低成立'),COLORWHITE;
STICKLINE(MACD>前高,MACD,前高,1,0),COLORYELLOW;
STICKLINE(WQG,MACD,0,1,0),COLORGREEN;
STICKLINE(MACD<0 AND MACD<前低 AND 前低<0,MACD,前低,1,0),COLORGREEN;
B1:=IF(CROSS(MACD<0,0.5),BARSNEXT(BDTJ),DRAWNULL);
TSB1:=BARSLAST(MACD>0)-1;
STICKLINE(BARSLAST(BDCL)>=0 AND MACD<前低 AND MACD<0,MACD,前低,1,0),COLORGREEN;
STICKLINE(BDCL,MACD,0,1,0),COLORWHITE;
STICKLINE(MACD>前高 AND 本高>前高 AND BARSLAST(WQG)>0,
MACD,前高,1,0),COLORRED;
DRAWTEXT(VA2 AND VA2!=UU,(MACD/10)*9,'前');
DRAWTEXT(VA2 AND VA2!=UU,MACD/10,'高');
DRAWTEXT(ZZ,(MACD/10)*9,'本'),COLORWHITE;
DRAWTEXT(ZZ,MACD/10,'高'),COLORWHITE;
DRAWTEXT(BDTJ,(MACD/10)*9,'低'),COLORRED;
DRAWTEXT(BDTJ,MACD/10,'本'),COLORRED;
IF(BARSLAST(BDCL)>=0,本低/2,DRAWNULL),COLORRED,DOTLINE;
DRAWTEXT_FIX(1,0.05,0.04,0,'【黑馬拉升由兩個階段構(gòu)成:同步上漲階段(黃芯柱)
和慣性上漲階段(背離階段、紅芯柱)】'),COLORFFFF00;
連續(xù)走強:LAST(MACD>REF(MACD,1) AND MACD>0,9,3),LINETHICK0,COLOR0030FF;{天}
強勢回調(diào):LAST(MACD<REF(MACD,1) AND MACD>0,7,3),LINETHICK0,COLOR0030FF;{天}
連續(xù)走弱:LAST(MACD<REF(MACD,1) AND MACD<0,9,5),LINETHICK0,COLOR00FF30;{天};
連續(xù)反彈:LAST(MACD>REF(MACD,1) AND MACD<0,5,3),LINETHICK0,COLOR00FF30;{天};
IF(DIFF<0,DIFF,0),COLORRED,LINETHICK3;
IF(DIFF<0,0,DIFF),COLORYELLOW,LINETHICK3;
IF(DIFF<DEA,DIFF,DEA),COLOR00FF00,LINETHICK3;
IF(DIFF>DEA,DEA,DEA),COLORBLUE,LINETHICK3;
中線:=EMA(C,10),COLOR0F00FF,LINETHICK0;
升線: STD(中線,7),COLORFF00FF,DOTLINE,LINETHICK1;
降線: -STD(中線,7),COLORGREEN,DOTLINE,LINETHICK1;
IF(升線>REF(升線,1)AND NOT(C<中線),升線,DRAWNULL),COLORRED ,LINETHICK2;
IF(升線>REF(升線,1)AND NOT(C<中線),升線,DRAWNULL),COLOR00FFFF ,POINTDOT,LINETHICK7;
IF(降線>REF(降線,1)AND NOT(C>中線),降線,DRAWNULL),COLORFFFF00 ,POINTDOT,LINETHICK7;
IF(降線>REF(降線,1)AND NOT(C>中線),降線,DRAWNULL),COLORFFFF00 ,LINETHICK2;
IF(降線<REF(降線,1),降線,DRAWNULL),COLOR00FF00 ,LINETHICK2;
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
STICKLINE(低位金叉,0,-0.10,6,0),COLORYELLOW;
DRAWTEXT(低位金叉,-0.05,' 低位金叉'),COLORYELLOW;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,-0.10,6,0),COLORFF00FF;
DRAWICON(二次金叉,DEA*1.04,13) ;
DRAWTEXT(二次金叉,-0.08,' 二次金叉'),COLORYELLOW;
A11:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背離:=REF(CLOSE,A11+1)>CLOSE AND DIFF>REF(DIFF,A11+1) AND CROSS(DIFF,DEA);
STICKLINE(底背離,0,0.13,6,0),COLORRED;
DRAWTEXT(底背離,DEA,' 底背離'),COLORRED;
A22:=BARSLAST(REF(CROSS(DEA,DIFF),1));
頂背離:=REF(CLOSE,A22+1)<CLOSE AND REF(DIFF,A22+1)>DIFF AND CROSS(DEA,DIFF);
DRAWTEXT(頂背離,DEA,' 頂背離'),COLORGREEN;
A1:=DIFF<0 AND DEA<0;
A2:=A1>REF(A1,1);
A3:=BARSLAST(A2);
A4:=COUNT(DEA>0 AND DIFF>0,A3)=0;
A5:=CROSS(DIFF,DEA);{金叉}
A6:=BARSLAST(A5);
A7:=REF(A6,A6+1)+A6;
A8:=(DIFF+DEA)/2;
A9:=(HIGH+LOW)/2;
A10:=A5 AND A7<A3 AND A4 AND A8>REF(A8,A7) AND A9<REF(A9,A7) AND MACD>0;
DRAWTEXT(A10,DIFF*0.95,'★金叉介入'),COLORYELLOW;
同步上漲階段(黃芯柱)的選股條件公式
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
VA1:=HHVBARS(MACD,BARSLAST(MACD<0)+1);
VA2:=CROSS(BACKSET(CROSS(0,MACD),REF(VA1,1)+2),0.5);
前高:=DRAWLINE(VA2,MACD,REF(VA2,1),REF(MACD,1),1);
MACD>前高;
聯(lián)系客服