主图
{K线图着重显示涨跌停}
BK:=IF(INBLOCK('科创板'),0.2,IF(INBLOCK('创业板'),0.2,IF(INBLOCK('ST板块'),0.05,0.1)));
XA_1:=IF(DATE<=1200823,1,0);
旧涨停:=(C>=ZTPRICE(REF(CLOSE,1),0.1) AND C=H) AND XA_1=1;
旧跌停:=(C<=DTPRICE(REF(CLOSE,1),0.1) AND C=L) AND XA_1=1;
涨停:=C>=ZTPRICE(REF(C,1),BK) AND C=H;
跌停:=C<=DTPRICE(REF(C,1),BK) AND C=L;
曾涨停:=(H>=ZTPRICE(REF(C,1),BK) AND C<H) OR (H>=ZTPRICE(REF(CLOSE,1),0.1) AND C<H AND XA_1=1);
曾跌停:=(L<=DTPRICE(REF(C,1),BK) AND C>L) OR (L<=DTPRICE(REF(CLOSE,1),0.1) AND C>L AND XA_1=1);
STICKLINE(旧涨停 AND PERIOD=5,O,C,3,0),COLORFF83FA;
STICKLINE(旧跌停 AND PERIOD=5,O,C,3,0),COLORGREEN;
STICKLINE(涨停 AND PERIOD=5,C,O,3,0),COLORFF00FF;
STICKLINE(跌停 AND PERIOD=5,C,O,3,0),COLORGREEN;
STICKLINE(曾涨停 AND PERIOD=5,H,L,0,0),COLORYELLOW;{涨停后回落}
STICKLINE(曾跌停 AND PERIOD=5,L,H,0,0),COLORGREEN;{跌停后回升}
上线:MA(CLOSE,5),COLORMAGENTA,LINETHICK2;
XA_2:=EMA((EMA(CLOSE,19)+EMA(CLOSE,20)+EMA(CLOSE,21))/3,3);
XA_3:=EMA(XA_2,3);
XA_4:=EMA((EMA(CLOSE,1)+EMA(CLOSE,3)+EMA(CLOSE,5))/3,3);
XA_5:=EMA(EMA(EMA(XA_4,1),2),3);
XA_6:=EMA((EMA(CLOSE,19)+EMA(CLOSE,20)+EMA(CLOSE,21))/3,3);
XA_7:=XA_6-(XA_4-XA_6);
下线:EMA(EMA(EMA(XA_7,1),2),3),COLORGREEN,LINETHICK2;
中线:(上线+下线)/2,DOTLINE,COLOR99EEEE;
XA_8:=150;
XA_9:=3;
XA_10:=REF(HHV(HIGH,XA_8),XA_9);
XA_11:=REF(LLV(LOW,XA_8),XA_9);
XA_12:=XA_10-(XA_10-XA_11)*0.886;
XA_13:=XA_10-(XA_10-XA_11)*0.946;
底二886:REFDATE(XA_12,DATE),DOTLINE,COLORFFCC00;
底一946:REFDATE(XA_13,DATE),COLORBLUE;
DRAWTEXT_FIX(ISLASTBAR,0.005,0.02,0,GNBLOCK),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0.005,0.06,0,EXTERNSTR(0,2)),COLORYELLOW;
副图1
DD11:0.9,COLORFF33FF;
DD22:1.2,COLORGREEN;
{黄金柱}
M:=30;
N:=15;
AJ:=HHV(H,M)=H;
AJT:=BARSLAST(AJ);
AJ1:=LLV(L,N)=L;
AJ1T:=BARSLAST(AJ1);
TJ:=HHV(H,M)=H;
TJT:BARSLAST(TJ)NODRAW;
TJ1T:=BARSLAST(AJ1);
{STICKLINE((TJT=0,H,TJ1T=0) AND AJ1 AND FILTERX(AJ1,TJT+1) ,REF(L,TJ1T)
,REF(H,TJT),0,0)COLORBLUE,LINETHICK3;}
OUT:=STICKLINE((TJT=0,H,TJ1T=0) AND AJ1 AND FILTERX(AJ1,TJT+1) ,REF(L,TJ1T)
,REF(H,TJT),0,0)COLORBLUE,LINETHICK3;
STICKLINE(OUT>0,0,0.89,4,0),COLORYELLOW,LINETHICK2;{黄色柱}
DRAWTEXT(OUT,0.95,'底'),COLORYELLOW;
{M:=30;
N:=15;
AJ1:=LLV(L,N)=L;
TJ:=HHV(H,M)=H;
TJT:=BARSLAST(TJ);
TJ1T:=BARSLAST(AJ1);
TJT=0,H,TJ1T=0 AND AJ1 AND FILTERX(AJ1,TJT+1) ;};
{KDJ日金}
日K:="KDJ.K#DAY"(9,3,3);
日D:="KDJ.D#DAY"(9,3,3);
DRAWICON(日K>日D,0.1,32);
DRAWICON(日K<日D,0.1,2);
DRAWTEXT(ISLASTBAR=1,0.1,'日K');
{MACD日金}
日DIF:="MACD.DIF#DAY"(12,26,9);
日DEA:="MACD.DEA#DAY"(12,26,9);
DRAWICON(日DIF>日DEA,0.2.1,32);
DRAWICON(日DIF<日DEA,0.2,2);
DRAWTEXT(ISLASTBAR=1,0.2,'日M');
{RSI日}
日RSI:="RSI.RSI1#DAY"(9);
DRAWICON(日RSI>50,0.3,32);
DRAWICON(日RSI<50,0.3,2);
DRAWTEXT(ISLASTBAR=1,0.3,'日R');
{KDJ周金}
周K:="KDJ.K#WEEK"(9,3,3);
周D:="KDJ.D#WEEK"(9,3,3);
DRAWICON(周K>周D,0.4,13);
DRAWICON(周K<周D,0.4,2);
DRAWTEXT(ISLASTBAR=1,0.4,'周K');
{MACD周金}
周DIF:="MACD.DIF#WEEK"(12,26,9);
周DEA:="MACD.DEA#WEEK"(12,26,9);
DRAWICON(周DIF>周DEA,0.5,13);
DRAWICON(周DIF<周DEA,0.5,2);
DRAWTEXT(ISLASTBAR=1,0.5,'周M');
{RSI周}
周RSI:="RSI.RSI1#WEEK"(9);
DRAWICON(周RSI>50,0.6,13);
DRAWICON(周RSI<50,0.6,2);
DRAWTEXT(ISLASTBAR=1,0.6,'周R');
{KDJ月金}
月K:="KDJ.K#MONTH"(9,3,3);
月D:="KDJ.D#MONTH"(9,3,3);
DRAWICON(月K>月D,0.7,33);
DRAWICON(月K<月D,0.7,2);
DRAWTEXT(ISLASTBAR=1,0.7,'月K');
{MACD月金}
月DIF:="MACD.DIF#MONTH"(12,26,9);
月DEA:="MACD.DEA#MONTH"(12,26,9);
DRAWICON(月DIF>月DEA,0.8,33);
DRAWICON(月DIF<月DEA,0.8,2);
DRAWTEXT(ISLASTBAR=1,0.8,'月M');
{RSI月}
月RSI:="RSI.RSI1#MONTH"(9);
DRAWICON(月RSI>50,0.9,33);
DRAWICON(月RSI<50,0.9,2);
DRAWTEXT(ISLASTBAR=1,0.9,'月R');
X1:=日K>日D;
X2:=日DIF>日DEA;
X3:=日RSI>50;
X4:=周K>周D;
X5:=周DIF>周DEA;
X6:=周RSI>50;
X7:=月K>月D;
X8:=月DIF>月DEA;
X9:=月RSI>50;
黑马初显:=X1 AND X2 AND X3 AND X4 AND X5 AND X6 AND X7 AND X8 AND X9;
STICKLINE(黑马初显,0.05,0.91,0.12,0),COLORRED;
STICKLINE(黑马初显 AND C/REF(C,1)>1.095,0.05,0.91,0.66,0),COLORYELLOW;
STICKLINE(黑马初显 AND C/REF(C,1)>1.095,0.05,0.91,0.06,0),COLORRED;
{DRAWTEXT(首周K,0.935,' --马坑'),COLORYELLOW;}
月RSI1:="RSI.RSI1#MONTH"(9),COLORWHITE;
A:=月RSI1>50;
首月R:CROSS(A>REF(A,1),0.5),COLORWHITE,LINETHICK3;
STICKLINE(首月R,1.2,1.12,5,0),COLORWHITE,LINETHICK3;
DRAWTEXT(首月R,1.11,' --月共振'),COLORWHITE;
月DIF1:="MACD.DIF#MONTH"(12,26,9)COLORYELLOW;
月DEA1:="MACD.DEA#MONTH"(12,26,9)COLORYELLOW;
AA:=月DIF1>月DEA1;
首月M:CROSS(AA>REF(AA,1),0.5)COLORYELLOW;
STICKLINE(首月M,1.15,1.1,5,0),COLORYELLOW;
月K1:="KDJ.K#MONTH"(9,3,3),COLORMAGENTA;
月D1:="KDJ.D#MONTH"(9,3,3),COLORMAGENTA;
AAA:=月K1>月D1;
首月K:CROSS(AAA>REF(AAA,1),0.5),COLORMAGENTA,LINETHICK3;
STICKLINE(首月K,1.1,1.05,5,0),COLORMAGENTA,LINETHICK3;
周RSI1:="RSI.RSI1#WEEK"(9),COLORGREEN;
AAAA:=周RSI1>50;
首周R:CROSS(AAAA>REF(AAAA,1),0.5),COLORRED,LINETHICK4;
STICKLINE(首周R,1.05,1,5,0),COLORRED,LINETHICK4;
DRAWTEXT(首周R,1.03,' --周共振'),COLORRED;
周DIF1:="MACD.DIF#WEEK"(12,26,9),COLORCYAN;
周DEA1:="MACD.DEA#WEEK"(12,26,9),COLORCYAN;
AAAAA:=周DIF1>周DEA1;
首周M:CROSS(AAAAA>REF(AAAAA,1),0.5),COLORCYAN;
STICKLINE(首周M,1,0.95,5,0),COLORCYAN;
周K1:="KDJ.K#WEEK"(9,3,3),COLORBLUE;
周D1:="KDJ.D#WEEK"(9,3,3),COLORBLUE;
AAAAAA:=周K1>周D1;
首周K:CROSS(AAAAAA>REF(AAAAAA,1),0.5),COLORBLUE;
STICKLINE(首周K,1.05,1,0,0),COLORBLUE,LINETHICK1;
STICKLINE(首周K,0.95,0.91,5,0),COLORBLUE;
DRAWTEXT(首周K,0.935,' --马坑'),COLORYELLOW;
DRAWTEXT(黑马初显,0.935,'-飚'),COLORYELLOW;
副图2 选股副图一体
X_1:=MAX(CLOSE,OPEN);
X_2:=MIN(CLOSE,OPEN);
X_3:=LOW=LLV(LOW,20) AND X_2/LOW>1.015 AND HIGH/X_1<X_2/LOW AND (X_1-X_2)/(X_2-LOW)<0.5;
X_4:=BARSLAST(X_3);
X_5:=REF((HIGH+LOW)/2,X_4);
X_6:=HHV(HIGH,30)>LLV(LOW,30)*1.8 AND COUNT(CLOSE/REF(CLOSE,1)>1.095,20)>3;
X_7:=BARSLAST(X_6);
X_8:=HHVBARS(HIGH,120);
X_9:=REF((HHV(HIGH,20)+LLV(LOW,50))/2,X_8);
XGSS:REF(X_6,X_8) AND X_3 AND X_5<X_9 AND CLOSE>X_5 AND LLV(LOW,2)<=LLV(LOW,X_8)*1.01;