V4-玩具十档版分时L2指标主副图原码
分时主图 (9楼有现成的公式和模板)
时长:=if(HOUR>=10 AND HOUR<15 ,1,0);{10点至 15点}
DRAWTEXTABS(0,5,'【板块】'+SelfString('行业')),Color808000,linethick1;
DRAWTEXTABS(110,5,'【地域】'+SelfString('地域')),Color77aa77,linethick1;
DRAWTEXTABS(200,5,'【概念】'+SelfString('概念')),Colorff6699,linethick1;
{叠加大盘线}
{TC:=STRCMP(STRLEFT(MARKETLABEL,2),'SZ');
DPSH:="SH000001$CLOSE"/HHV(STKINDI('SH000001','FYYY.昨收#DAY'),0);
DPSZ:="SZ399001$CLOSE"/HHV(STKINDI('SZ399001','FYYY.昨收#DAY'),0);
DPC:=IF(INBLOCK('A股板块'),DYNAINFO(3)*IF(TC=0,DPSZ,DPSH),C);
POLYLINE(C>0,DPC),COLOR3399ff,LINETHICK1,LAYER0;
大盘:=NUMTOSTRN(INDEXC,2);
DRAWTEXT( BARSTATUS=2,DPC ,'大盘:'+大盘),Color3399ff;}
均线:=IF(BETWEEN(C/(SUM(AMOUNT,0)/SUM(VOL*100,0)),1.05,0.95)=0,MA(C,0),(SUM(AMOUNT,0)/SUM(VOL*100,0)));
均线H:(均线*1.007 ),COLORFF6600,LINETHICK0,LAYER0;
均线L:(均线/1.005 ),COLOR00FF00,LINETHICK0;
{FILLRGN(均线L,均线,c>均线L and c<均线H),COLORYELLOW;}
均线横盘:=C<均线H and C>均线L;
量比:=sum(vol,0)*240/dynainfo(38)/barscount(c);
量比5分钟:=sum(量比,5);
量比10:=sum(量比,10);
上个5分钟量比:=量比10-量比5分钟;
放量:=sum(VOL,6)>REF(ma(VOL,30),1)*10;
CC:CLOSE,COLORWHITE,LINETHICK2;
partline(CC,CC>=ref(CC,1),rgb(255,151,255),CC<ref(CC,1),rgb(0,255,255)),linethick2;
DYNAINFO(5),DOTLINE,colorff00ff;
DYNAINFO(6),DOTLINE,color00ff00;
{最新价:=NUMTOSTRN(DYNAINFO(7),2);
涨幅:=NUMTOSTRN(DYNAINFO(14)*100,2);
DRAWTEXT( BARSTATUS=2,CC ,' 最新价:'+最新价+' 涨幅:'+涨幅+'%'),Colorffffff;
均价:=NUMTOSTRN(DYNAINFO(11),2);
DRAWTEXT( BARSTATUS=2,均线 ,'均价:'+均价),Color00ffff;}
横盘:=((HHV(CLOSE,BARSCOUNT(CLOSE))-LLV(CLOSE,BARSCOUNT(CLOSE)))/CLOSE)<1;
横涨:量比5分钟>上个5分钟量比 and 横盘 and 时长 and 放量 and (CC>均线H) and DYNAINFO(22)<DYNAINFO(23),LINETHICK0;
横跌:=横盘 and 时长 and 放量 and CROSS(均线L,CC) ;
DRAWTEXT(CROSS(横涨,0),均线,'▲'),COLORRED,LAYER0;
突破:FILTER(横涨,100),LINETHICK0;
下破:=FILTER(横跌,50);
DRAWTEXT(突破,均线H,'★突破'),COLORFF00FF,LAYER0;
DRAWTEXT(下破,均线L,'★下破'),COLOR00FF00,LAYER0;
VERTLINE(突破,3),COLORFF00FF,LINETHICK3;
VERTLINE(下破,3),COLOR00FF00,LINETHICK3;
RC:=DYNAINFO( 3);
S2:=SMA(C,2,1);
S6:=SMA(C,3,1);
DK:=3*(S2-S6);
STICKLINE(DK>0,RC,(RC+DK),0,1),COLORRED;
STICKLINE(DK<0,RC,(RC+DK),0,1),COLORgreen;
MA30:=EMA(CLOSE,30);
强弱界定:=EMA(CLOSE,900);
{STICKLINE((MA30>强弱界定),MA30,强弱界定,1,0),Color0000FF;
STICKLINE((MA30<强弱界定),MA30,强弱界定,1,0),Color00FF00;}
DRAWICON(CROSS(MA30,强弱界定),H,7),LAYER0;
H1:=MAX(DYNAINFO(3),DYNAINFO(5));
L1:=MIN(DYNAINFO(3),DYNAINFO(6));
P1:=H1-L1;
阻力:L1+P1*7/8,COLORYELLOW,LINETHICK0;
支撑:L1+P1*0.5/8,COLORff00ff,LINETHICK0;
DRAWTEXTABS(0,20,'阻力:'+NUMTOSTRN(阻力,2)),LINETHICK2,ColorYELLOW;
DRAWTEXTABS(0,35,'支撑:'+NUMTOSTRN(支撑,2)),LINETHICK2,Colorff00ff;
{有庄显示}
VAR1:=EMA(EMA(CLOSE,13),13);
控盘:=(VAR1-REF(VAR1,1))/REF(VAR1,1)*1000;
BTJ2:=控盘>REF(控盘,1) AND 控盘<-0.2;
JJ:=DYNAINFO(11);
P:=55;S:=8;M1:=3;
财:=(EMA(CLOSE,S)-EMA(CLOSE,P))*10;
神:=EMA(财,M1);
BTJ3:=CROSS(财,神) AND 财<-0.3;
BTJ11:=(C-JJ)/JJ<-0.03;
有庄:FILTER(BTJ11 AND BTJ2 AND BTJ3,13),linethick0;{BTJ811}
VERTLINE(有庄,1),coloryellow;
DRAWTEXT(有庄,均线L,'★有庄'),COLOR00FFFF,LAYER0;
{DRAWTEXTABS(10,180,'■所属板块:'+BKNAME),ColorYELLOW,linethick1;
流通盘大小:=FINANCE2(37)/1000000*100;
DRAWTEXTABS(280,200,'流通盘大小:'+NUMTOSTRN(流通盘大小,2)+'亿'),LINETHICK1,ColorYELLOW;
每股收益:=FINANCE2(3);
每股市盈率:=DYNAINFO(39);
每股净资产:=FINANCE2(4);
销shou毛利率:=FINANCE2(12);
主营收入同比:=FINANCE2(11);
净利润同比增长:=FINANCE2(10);
DRAWTEXTABS(170,200,'每股收益:'+NUMTOSTRN(每股收益,2)+'元'),COLOR00FF00;
DRAWTEXTABS(170,220,'每股市盈率:'+NUMTOSTRN(每股市盈率,1)+'倍'),COLORRED;
DRAWTEXTABS(170,240,'每股净资产:'+NUMTOSTRN(每股净资产,2)+'元'),COLORRED;
DRAWTEXTABS(20,200,'销shou毛利率:'+NUMTOSTRN(销shou毛利率,2)+'%'),LINETHICK1,COLOR00FF00;
DRAWTEXTABS(20,220,'主营收入同比增长:'+NUMTOSTRN(主营收入同比,2)+'%'),LINETHICK1,COLOR00FF00;
DRAWTEXTABS(20,240,'净利润同比增长:'+NUMTOSTRN(净利润同比增长,2)+'%'),LINETHICK1,COLOR00FF00;};
{分时超赢}
ZLLR:=SUM((AMOUNT*(DYNAINFO(95)+DYNAINFO(94))/10000),0);
ZLLC:=SUM((AMOUNT*(DYNAINFO(98)+DYNAINFO(97))/10000),0);
主净:ZLLR-ZLLC,COLOR00FFFF,LINETHICK0,PRECIS2;
TDLR:=SUM((AMOUNT*DYNAINFO(95)/10000),0);
TDLC:=SUM((AMOUNT*DYNAINFO(98)/10000),0);
超净:TDLR-TDLC,COLORFF00FF,LINETHICK0,PRECIS2;
DDLR:=SUM((AMOUNT*DYNAINFO(94)/10000),0);
DDLC:=SUM((AMOUNT*DYNAINFO(97)/10000),0);
大净:DDLR-DDLC,COLOR00FF00,LINETHICK0,PRECIS2;
ZDLR:=SUM((AMOUNT*DYNAINFO(93)/10000),0);
ZDLC:=SUM((AMOUNT*DYNAINFO(96)/10000),0);
中净:ZDLR-ZDLC,COLORB5B5B5,LINETHICK0,PRECIS2;
XDLR:=IF(AMOUNT*(DYNAINFO(95)+DYNAINFO(94)+DYNAINFO(93))>0,SUM(((AMOUNT-AMOUNT*(DYNAINFO(95)+DYNAINFO(94)+DYNAINFO(93)))/10000),0),0);
XDLC:=IF(AMOUNT*(DYNAINFO(98)+DYNAINFO(97)+DYNAINFO(96))>0,SUM(((AMOUNT-AMOUNT*(DYNAINFO(98)+DYNAINFO(97)+DYNAINFO(96)))/10000),0),0);
散净:XDLR-XDLC,COLORFF9911,LINETHICK0;
{画柱图};
最大值:=200/(MAX(散净,中净,大净,超净,主净));
散户净买:=600-(ABS(散净)*最大值);
中户净买:=600-(ABS(中净)*最大值);
大户净买:=600-(ABS(大净)*最大值);
超大净买:=600-(ABS(超净)*最大值);
主力净买:=600-(ABS(主净)*最大值);
{各单增减比例显示}
ZLB:=SUM((ORDERVOL(1,2)/CAPITAL*100),0);
ZLS:=SUM((ORDERVOL(2,2)/CAPITAL*100),0);
主增:=ZLB-ZLS;
TDB:=SUM((ORDERVOL(1,3)/CAPITAL*100),0);
TDS:=SUM((ORDERVOL(2,3)/CAPITAL*100),0);
超增:=TDB-TDS;
DDB:=SUM(((ORDERVOL(1,2)/CAPITAL*100-ORDERVOL(1,3)/CAPITAL*100)),0);
DDS:=SUM(((ORDERVOL(2,2)/CAPITAL*100-ORDERVOL(2,3)/CAPITAL*100)),0);
大增:=DDB-DDS;
ZDB:=SUM(((ORDERVOL(1,1)/CAPITAL*100-ORDERVOL(1,2)/CAPITAL*100)),0);
ZDS:=SUM(((ORDERVOL(2,1)/CAPITAL*100-ORDERVOL(2,2)/CAPITAL*100)),0);
中增:=ZDB-ZDS;
XDB:=SUM(((VOL-ORDERVOL(1,1))/CAPITAL*100),0);
XDS:=SUM(((VOL-ORDERVOL(2,1))/CAPITAL*100),0);
散增:=XDB-XDS;
{DRAWRECTREL(330,主力买,350,610,RGB(200,0,0)),COLOR000000,LAYER5;
DRAWRECTREL(350,主力卖,370,610,RGB(0,200,0)),COLOR000000,LAYER5;}
DRAWRECTREL(640,主力净买,670,640,(IF((主净 >= 0),RGB(255,0,0),RGB(0,255,0)))),COLOR000000,LAYER5;
{DRAWRECTREL(445,超大买,465,610,RGB(200,0,0)),COLOR000000,LAYER5;
DRAWRECTREL(465,超大卖,485,610,RGB(0,200,0)),COLOR000000,LAYER5;}
DRAWRECTREL(720,超大净买,750,640,(IF((超净 >= 0),RGB(200,0,255),RGB(0,255,255)))),COLOR000000,LAYER5;
{DRAWRECTREL(560,大户买,580,610,RGB(200,0,0)),COLOR000000,LAYER5;
DRAWRECTREL(580,大户卖,600,610,RGB(0,200,0)),COLOR000000,LAYER5;}
DRAWRECTREL(800,大户净买,830,640,(IF((大净 >= 0),RGB(200,0,255),RGB(0,255,255)))),COLOR000000,LAYER5;
{DRAWRECTREL(675,中户买,695,610,RGB(200,0,0)),COLOR000000,LAYER5;
DRAWRECTREL(695,中户卖,715,610,RGB(0,200,0)),COLOR000000,LAYER5;}
DRAWRECTREL(880,中户净买,910,640,(IF((中净 >= 0),RGB(200,0,255),RGB(0,255,255)))),COLOR000000,LAYER5;
{DRAWRECTREL(790,散户买,810,610,RGB(200,0,0)),COLOR000000,LAYER5;
DRAWRECTREL(810,散户卖,830,610,RGB(0,200,0)),COLOR0000 |