创业板:=INBLOCK('创业板');
中小企业:=INBLOCK('中小板');
上证A股:=INBLOCK('上证A股');
深证A股:=INBLOCK('深证A股');
INDEH:=IF(中小企业=1,"399005$H",IF(创业板=1,"399006$H",IF(上证A股=1,"999999$H","399001$H"))),NODRAW;
INDEO:=IF(中小企业=1,"399005$O",IF(创业板=1,"399006$O",IF(上证A股=1,"999999$O","399001$O"))),NODRAW;
INDEL:=IF(中小企业=1,"399005$L",IF(创业板=1,"399006$L",IF(上证A股=1,"999999$L","399001$L"))),NODRAW;
INDEC:=IF(中小企业=1,"399005$C",IF(创业板=1,"399006$C",IF(上证A股=1,"999999$C","399001$C"))),NODRAW;
板块:=IF(中小企业=1,'中小板指数',IF(创业板=1,'创业板指数',IF(上证A股=1,'上证指数','深证指数')));
指数涨幅:=(INDEC-REF(INDEC,1))*100/REF(INDEC,1);
{A:=STRCAT(板块,STRCAT(':',CON2STR(INDEC,2)));
B:=STRCAT(STRCAT('指数涨跌:',CON2STR(指数涨幅,2)),' %');
DRAWTEXT_FIX(ISLASTBAR,0,0,0,A),COLOR0055FF;
DRAWTEXT_FIX(ISLASTBAR,0.1,0,0,B),COLOR0055FF;}
CCC:=HY_INDEXC;
OOO:=HY_INDEXO;
LLL:=HY_INDEXL;
HHH:=HY_INDEXH;
DRAWKLINE(HHH,OOO,LLL,CCC);
MA5:MA(CCC,5);
MA10:MA(CCC,10);
MA30:MA(CCC,20);
MA60:MA(CCC,60);
沪A涨家数:="999999$ADVANCE",COLORRED,NODRAW;
沪A跌家数:="999999$DECLINE",COLORGREEN,NODRAW;
深A涨家数:="399001$ADVANCE",COLORRED,NODRAW;
深A跌家数:="399001$DECLINE",COLORGREEN,NODRAW;
创业涨家数:="399006$ADVANCE",COLORRED,NODRAW;
创业跌家数:="399006$DECLINE",COLORGREEN,NODRAW;
上涨总家数:=沪A涨家数+深A涨家数,COLORRED,NODRAW;
下跌总家数:=沪A跌家数+深A跌家数,COLORGREEN,NODRAW;
上涨总家数比:=上涨总家数/(上涨总家数+下跌总家数)*100,COLORRED,NODRAW;
下跌总家数比:=下跌总家数/(上涨总家数+下跌总家数)*100,COLORGREEN,NODRAW;
沪A上涨家数比:=沪A涨家数/(沪A涨家数+沪A跌家数)*100,COLORRED,NODRAW;
沪A下跌家数比:=沪A跌家数/(沪A涨家数+沪A跌家数)*100,COLORGREEN,NODRAW;
深A上涨家数比:=深A涨家数/(深A涨家数+深A跌家数)*100,COLORRED,NODRAW;
深A下跌家数比:=深A跌家数/(深A涨家数+深A跌家数)*100,COLORGREEN,NODRAW;
创业上涨家数比:=创业涨家数/(创业涨家数+创业跌家数)*100,COLORRED,NODRAW;
创业下跌家数比:=创业跌家数/(创业涨家数+创业跌家数)*100,COLORGREEN,NODRAW;
BBB1:=STRCAT('沪A涨家数: ',CON2STR(沪A涨家数,0));
DRAWTEXT_FIX(ISLASTBAR,0,0.00,0,BBB1),COLORRED;
BBB2:=STRCAT('沪A跌家数: ',CON2STR(沪A跌家数,0));
DRAWTEXT_FIX(ISLASTBAR,0,0.06,0,BBB2),COLORGREEN;
AAA3:=STRCAT(STRCAT('沪A上涨比 ',CON2STR(沪A上涨家数比,0)),' %');
DRAWTEXT_FIX(ISLASTBAR,0,0.12,0,AAA3),COLORRED;
AAA4:=STRCAT(STRCAT('沪A下跌比 ',CON2STR(沪A下跌家数比,0)),' %');
DRAWTEXT_FIX(ISLASTBAR,0,0.18,0,AAA4),COLORGREEN;
BBB3:=STRCAT('深A涨家数: ',CON2STR(深A涨家数,0));
DRAWTEXT_FIX(ISLASTBAR,0.1,0.00,0,BBB3),COLORRED;
BBB4:=STRCAT('深A跌家数: ',CON2STR(深A跌家数,0));
DRAWTEXT_FIX(ISLASTBAR,0.1,0.06,0,BBB4),COLORGREEN;
AAA5:=STRCAT(STRCAT('深A上涨家数比 ',CON2STR(深A上涨家数比,0)),' %');
DRAWTEXT_FIX(ISLASTBAR,0.1,0.12,0,AAA5),COLORRED;
AAA6:=STRCAT(STRCAT('深A下跌家数比 ',CON2STR(深A下跌家数比,0)),' %');
DRAWTEXT_FIX(ISLASTBAR,0.1,0.18,0,AAA6),COLORGREEN;
BBB7:=STRCAT('创业涨家数: ',CON2STR(创业涨家数,0));
DRAWTEXT_FIX(ISLASTBAR,0.2,0.00,0,BBB7),COLORRED;
BBB8:=STRCAT('创业跌家数: ',CON2STR(创业跌家数,0));
DRAWTEXT_FIX(ISLASTBAR,0.2,0.06,0,BBB8),COLORGREEN;
AAA9:=STRCAT(STRCAT('创业涨数比: ',CON2STR(创业上涨家数比,0)),' %');
DRAWTEXT_FIX(ISLASTBAR,0.2,0.12,0,AAA9),COLORRED;
AAA10:=STRCAT(STRCAT('创业跌数比: ',CON2STR(创业下跌家数比,0)),' %');
DRAWTEXT_FIX(ISLASTBAR,0.2,0.18,0,AAA10),COLORGREEN;
TAX:=HORCALC(HYBLOCK,105,1,DRAWNULL);
TAA:=STRCAT(HYBLOCK,' 排名 :');
DRAWTEXT_FIX(ISLASTBAR,0.91,0.91,0,STRCAT(TAA,CON2STR(TAX,0))),COLORMAGENTA;
ZF:=(C-REF(C,1))/REF(C,1)*100;
行业指数:=(CCC-REF(CCC,1))*100/REF(CCC,1);
DD:=STRCAT('行业指数:',CON2STR(CCC,2));
E:=STRCAT(STRCAT('行业涨跌:',CON2STR(行业指数,2)),' %');
DRAWTEXT_FIX(ISLASTBAR,0.3,0,0,DD),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.3,0.06,0,E),COLORYELLOW;
上涨:=VARCAT('行业上涨:',VAR2STR(HY_INDEXADV,0));
DRAWTEXT_FIX(ISLASTBAR,0.3,0.12,0,上涨),COLORRED;
下跌:=VARCAT('行业下跌:',VAR2STR(HY_INDEXDEC,0));
DRAWTEXT_FIX(ISLASTBAR,0.3,0.18,0,下跌),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR,0.4,0,0,HYBLOCK),COLORYELLOW;{所属行业}
DRAWTEXT_FIX(ISLASTBAR AND 指数涨幅<=行业指数,0.5,0,0,'板块强'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR AND 指数涨幅>行业指数,0.5,0,0,'板块弱'),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR AND ZF>=行业指数,0.6,0,0,'个股强'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR AND ZF<行业指数,0.6,0,0,'个股弱'),COLORCYAN;
{DRAWTEXT_FIX(1,0.0,0.43,0,'【说明:早盘如果持有的股票:板弱、股弱。遇到急拉,坚决高抛低吸。】'),COLOR0080FF;
DRAWTEXT_FIX(1,0.0,0.50,0,'【如果板强、股弱:等待股弱转股强。如果盘中一直处于板强、股弱:坚决做T】'),COLOR0080FF;
DRAWTEXT_FIX(1,0.0,0.57,0,'【遇到板强、股强:持股不动。遇到板弱、股强:看个股量,如果放量强持股不动。如果急拉不放量,应高抛低吸】'),COLOR0080FF;
DRAWTEXT_FIX(1,0.0,0.64,0,'【遇到上涨家数迅速增加:考虑补仓或者持股不动,反之减仓。】'),COLOR0080FF;}
个股强弱:=(CLOSE-MA(CLOSE,30))/MA(CLOSE,30)*100,COLORWHITE;
行业强弱:=(HY_INDEXC-MA(HY_INDEXC,30))/MA(HY_INDEXC,30)*100,COLORYELLOW,LINETHICK2;
大盘强弱:=(INDEXC-MA(INDEXC,30))/MA(INDEXC,30)*100,COLORRED,LINETHICK4;
A:=REF(HY_INDEXC,1);
涨幅:IF(A>0,(HY_INDEXC-A)*100/A,0),NODRAW;
HYDB:DRAWKLINE(HY_INDEXH,HY_INDEXO,HY_INDEXL,HY_INDEXC);
MA3:=MA(HY_INDEXC,3);
H1:=HY_INDEXH;
L1:=HY_INDEXL;
C1:=HY_INDEXC;
O1:=HY_INDEXO;
V1:=HY_INDEXV;
{阳胜,阴胜}
双阳胜:=C1>REF(O1,1) AND REF(C1<O1,1) AND V1>REF(V1,1);
阳胜:=C1>REF(C1,1) AND REF(C1<O1,1) AND C1>REF(O1,1) AND V1<REF(V1,1);
量胜:=C1>REF(C1,1) AND REF(C1<O1,1) AND V1>REF(V1,1) AND REF(O1,1)>C1;
单阳胜:=IF(阳胜 OR 量胜,1,0);
STICKLINE((双阳胜) AND BETWEEN(C,0,4000),O1,O1+(C1-O1)/10,3,0),COLORMAGENTA;
STICKLINE((单阳胜) AND BETWEEN(C,0,4000),O1+(C1-O1)/3,O1+(C1-O1)/3,3,0),COLORMAGENTA;
双阴胜:=C1<REF(O1,1) AND REF(C1>O1,1) AND V1>REF(V1,1);
价阴胜:=REF(C1>O1,1) AND C1<REF(O1,1) AND V1<REF(V1,1);
量阴胜:=REF(C1>O1,1) AND C1>REF(O1,1) AND V1>REF(V1,1) AND C1<O1 AND C1<REF(C1,1);
单阴胜:=IF(价阴胜 OR 量阴胜,1,0);
STICKLINE((双阴胜) AND BETWEEN(C1,0,4000),O1,O1+(C1-O1)/10,3,0),COLORBLUE;
STICKLINE((单阴胜) AND BETWEEN(C1,0,4000),O1+(C1-O1)/2,O1+(C1-O1)/2,3,0),COLORBLUE;