DRAWGBK(DATE 900101,COLORRGB(15,50,90),COLORRGB(0,0,0),1);//蓝色
input:of(0,0,1),n(21,0,300),x(0,-50,50);
A:=BARPOS;
A1:=SYSPARAM(1);
A2:=SYSPARAM(2);
A3:=SYSPARAM(3);
B:=DATACOUNT;
KB:=B-A+1;
HM:=A3-A2;
HMS:=IF(HM =87,HM*0.2,IF(HM 87 AND HM =132,HM*0.15,IF(HM 132 AND HM =199,HM*0.1,IF(HM 199 AND HM =300,HM*0.08,HM*0.05))));
P:=CLOSE;
Y:=IF(X=0,P[A1],DYNAINFO(7)*(1+X/100));
Q1:=13;
Q2:=55;
Q3:=156;
BK1:=INBLOCK('A股板块');
BK2:=INBLOCK('深圳权证');
BK3:=INBLOCK('上海权证');
BK4:=INBLOCK('上海指数');
BK5:=INBLOCK('深圳指数');
流通:=IF((BK1 OR BK2 OR BK3)=1,CAPITAL,IF(BK4=1,ESTDATA(1),IF(BK5=1,ESTDATA(2),0)));
盈1:=(SUM(IF(CLOSE Y,VOL,0),Q1))/流通*100;
盈2:=(SUM(IF(CLOSE Y,VOL,0),N))/流通*100;
盈:=(SUM(IF(CLOSE Y,VOL,0),Q2))/流通*100;
盈4:=(SUM(IF(CLOSE Y,VOL,0),Q3))/流通*100;
亏1:=(SUM(IF(CLOSE =Y,VOL,0),Q1))/流通*100;
亏2:=(SUM(IF(CLOSE =Y,VOL,0),N))/流通*100;
亏:=(SUM(IF(CLOSE =Y,VOL,0),Q2))/流通*100;
亏4:=(SUM(IF(CLOSE =Y,VOL,0),Q3))/流通*100;
M1:=盈1/(盈1+亏1)*100;
M2:=盈2/(盈2+亏2)*100;
M3:=盈/(盈+亏)*100;
M4:=盈4/(盈4+亏4)*100;
N1:=亏1/(盈1+亏1)*100;
N2:=亏2/(盈2+亏2)*100;
N3:=亏/(盈+亏)*100;
N4:=亏4/(盈4+亏4)*100;
周期换手:盈2+亏2,LINETHICK0,colorFFFFFF;
均手:周期换手/N,LINETHICK0,colorFFFF;
获利:=M3;
套牢:=100-M3;
基准价:DYNAINFO(7),LINETHICK0,colorFFFFFF;
ZD:=MAX(盈,亏);
ZX:=MIN(盈,亏);
HQ:=HHV(ZD,HM+0);
LQ:=LLV(ZX,HM+0);
ZH:=HQ[B];
ZL:=LQ[B];
Q:=(ZH-ZL)/10;
W:=A=A3;
STICKLINE(BACKSET(W,N1[A1]*0.2) 0 AND N1[A1] M1[A1],ZH-0*Q,ZH-2.5*Q,10,0),SHIFT3,colorFF8595;
STICKLINE(BACKSET(W,N2[A1]*0.2) 0 AND N2[A1] M2[A1],ZH-2.5*Q,ZH-5*Q,10,0),SHIFT3,colorFF8595;
STICKLINE(BACKSET(W,N3[A1]*0.2) 0 AND N3[A1] M3[A1],ZH-5*Q,ZH-7.5*Q,10,0),SHIFT3,colorFF8595;
STICKLINE(BACKSET(W,N4[A1]*0.2) 0 AND N4[A1] M4[A1],ZH-7.5*Q,ZH-10*Q,10,0),SHIFT3,colorFF8595;
STICKLINE(BACKSET(W,N1[A1]*0.2) 0 AND N1[A1] M1[A1],ZH-0*Q,ZH-0*Q,10,0),SHIFT3,colorFFC8C8;
STICKLINE(BACKSET(W,N2[A1]*0.2) 0 AND N2[A1] M2[A1],ZH-2.5*Q,ZH-2.5*Q,10,0),SHIFT3,colorFFC8C8;
STICKLINE(BACKSET(W,N3[A1]*0.2) 0 AND N3[A1] M3[A1],ZH-5*Q,ZH-5*Q,10,0),SHIFT3,colorFFC8C8;
STICKLINE(BACKSET(W,N4[A1]*0.2) 0 AND N4[A1] M4[A1],ZH-7.5*Q,ZH-7.5*Q,10,0),SHIFT3,colorFFC8C8;
STICKLINE(BACKSET(W,N4[A1]*0.2) 0 AND N4[A1] M4[A1],ZH-10*Q,ZH-10*Q,10,0),SHIFT3,colorFFC8C8;
STICKLINE(BACKSET(W,M1[A1]*0.2) 0,ZH-0*Q,ZH-2.5*Q,10,0),SHIFT3,colorB76FFF;
STICKLINE(BACKSET(W,M2[A1]*0.2) 0,ZH-2.5*Q,ZH-5*Q,10,0),SHIFT3,colorB76FFF;
STICKLINE(BACKSET(W,M3[A1]*0.2) 0,ZH-5*Q,ZH-7.5*Q,10,0),SHIFT3,colorB76FFF;
STICKLINE(BACKSET(W,M4[A1]*0.2) 0,ZH-7.5*Q,ZH-10*Q,10,0),SHIFT3,colorB76FFF;
STICKLINE(BACKSET(W,M1[A1]*0.2) 0,ZH-0*Q,ZH-0*Q,10,0),SHIFT3,colorE8D0FF;
STICKLINE(BACKSET(W,M2[A1]*0.2) 0,ZH-2.5*Q,ZH-2.5*Q,10,0),SHIFT3,colorE8D0FF;
STICKLINE(BACKSET(W,M3[A1]*0.2) 0,ZH-5*Q,ZH-5*Q,10,0),SHIFT3,colorE8D0FF;
STICKLINE(BACKSET(W,M4[A1]*0.2) 0,ZH-7.5*Q,ZH-7.5*Q,10,0),SHIFT3,colorE8D0FF;
STICKLINE(BACKSET(W,M4[A1]*0.2) 0,ZH-10*Q,ZH-10*Q,10,0),SHIFT3,colorE8D0FF;
STICKLINE(BACKSET(W,N1[A1]*0.2) 0 AND N1[A1] M1[A1],ZH-0.01*Q,ZH-2.5*Q,10,0),SHIFT3,colorFF8595;
STICKLINE(BACKSET(W,N2[A1]*0.2) 0 AND N2[A1] M2[A1],ZH-2.5*Q,ZH-5*Q,10,0),SHIFT3,colorFF8595;
STICKLINE(BACKSET(W,N3[A1]*0.2) 0 AND N3[A1] M3[A1],ZH-5*Q,ZH-7.5*Q,10,0),SHIFT3,colorFF8595;
STICKLINE(BACKSET(W,N4[A1]*0.2) 0 AND N4[A1] M4[A1],ZH-7.5*Q,ZH-10*Q,10,0),SHIFT3,colorFF8595;
STICKLINE(BACKSET(W,N1[A1]*0.2) 0 AND N1[A1] M1[A1],ZH-0*Q,ZH-0*Q,10,0),SHIFT3,colorFFC8C8;
STICKLINE(BACKSET(W,N2[A1]*0.2) 0 AND N2[A1] M2[A1],ZH-2.5*Q,ZH-2.5*Q,10,0),SHIFT3,colorFFC8C8;
STICKLINE(BACKSET(W,N3[A1]*0.2) 0 AND N3[A1] M3[A1],ZH-5*Q,ZH-5*Q,10,0),SHIFT3,colorFFC8C8;
STICKLINE(BACKSET(W,N4[A1]*0.2) 0 AND N4[A1] M4[A1],ZH-7.5*Q,ZH-7.5*Q,10,0),SHIFT3,colorFFC8C8;
STICKLINE(BACKSET(W,N4[A1]*0.2) 0 AND N4[A1] M4[A1],ZH-10*Q,ZH-10*Q,10,0),SHIFT3,colorFFC8C8;
{www.9m8.cn 九毛八公式指标网 股票软件下载网_最新股票指标公式}
MM:=(A3-A2)/100;
DW0:=A=A2+ROUND(MM*55);
DW1:=A=A2+ROUND(MM*65);
DW2:=A=A2+ROUND(MM*48);
DW3:=A=A2+ROUND(MM*100);
DW4:=A=A2+ROUND(MM*75);
DW5:=A=A2+ROUND(MM*40);
STICKLINE(OF=0 AND BACKSET(DW1,亏1[A1]*0.2) 0 AND 亏1[A1] 盈1[A1],ZH-0*Q,ZH-2.5*Q,10,0),colorFF8595;
STICKLINE(OF=0 AND BACKSET(DW1,亏2[A1]*0.2) 0 AND 亏2[A1] 盈2[A1],ZH-2.5*Q,ZH-5*Q,10,0),colorFF8595;
STICKLINE(OF=0 AND BACKSET(DW1,亏[A1]*0.2) 0 AND 亏[A1] 盈[A1],ZH-5*Q,ZH-7.5*Q,10,0),colorFF8595;
STICKLINE(OF=0 AND BACKSET(DW1,亏4[A1]*0.2) 0 AND 亏4[A1] 盈4[A1],ZH-7.5*Q,ZH-10*Q,10,0),colorFF8595;
STICKLINE(OF=0 AND BACKSET(DW1,亏1[A1]*0.2) 0 AND 亏1[A1] 盈1[A1],ZH-0*Q,ZH-0*Q,10,0),colorFFC8C8;
STICKLINE(OF=0 AND BACKSET(DW1,亏2[A1]*0.2) 0 AND 亏2[A1] 盈2[A1],ZH-2.5*Q,ZH-2.5*Q,10,0),colorFFC8C8;
STICKLINE(OF=0 AND BACKSET(DW1,亏[A1]*0.2) 0 AND 亏[A1] 盈[A1],ZH-5*Q,ZH-5*Q,10,0),colorFFC8C8;
STICKLINE(OF=0 AND BACKSET(DW1,亏4[A1]*0.2) 0 AND 亏4[A1] 盈4[A1],ZH-7.5*Q,ZH-7.5*Q,10,0),colorFFC8C8;
STICKLINE(OF=0 AND BACKSET(DW1,亏4[A1]*0.2) 0 AND 亏4[A1] 盈4[A1],ZH-10*Q,ZH-10*Q,10,0),colorFFC8C8;
STICKLINE(OF=0 AND BACKSET(DW1,盈1[A1]*0.2) 0,ZH-0*Q,ZH-2.5*Q,10,0),colorB76FFF;
STICKLINE(OF=0 AND BACKSET(DW1,盈2[A1]*0.2) 0,ZH-2.5*Q,ZH-5*Q,10,0),colorB76FFF;
STICKLINE(OF=0 AND BACKSET(DW1,盈[A1]*0.2) 0,ZH-5*Q,ZH-7.5*Q,10,0),colorB76FFF;
STICKLINE(OF=0 AND BACKSET(DW1,盈4[A1]*0.2) 0,ZH-7.5*Q,ZH-10*Q,10,0),colorB76FFF;
STICKLINE(OF=0 AND BACKSET(DW1,盈1[A1]*0.2) 0,ZH-0*Q,ZH-0*Q,10,0),colorE8D0FF;
STICKLINE(OF=0 AND BACKSET(DW1,盈2[A1]*0.2) 0,ZH-2.5*Q,ZH-2.5*Q,10,0),colorE8D0FF;
STICKLINE(OF=0 AND BACKSET(DW1,盈[A1]*0.2) 0,ZH-5*Q,ZH-5*Q,10,0),colorE8D0FF;
STICKLINE(OF=0 AND BACKSET(DW1,盈4[A1]*0.2) 0,ZH-7.5*Q,ZH-7.5*Q,10,0),colorE8D0FF;
STICKLINE(OF=0 AND BACKSET(DW1,盈4[A1]*0.2) 0,ZH-10*Q,ZH-10*Q,10,0),colorE8D0FF;
STICKLINE(OF=0 AND BACKSET(DW1,亏1[A1]*0.2) 0 AND 亏1[A1] 盈1[A1],ZH-1.25*Q,ZH-2.5*Q,10,0),colorFF8595;
STICKLINE(OF=0 AND BACKSET(DW1,亏2[A1]*0.2) 0 AND 亏2[A1] 盈2[A1],ZH-2.5*Q,ZH-5*Q,10,0),colorFF8595;
STICKLINE(OF=0 AND BACKSET(DW1,亏[A1]*0.2) 0 AND 亏[A1] 盈[A1],ZH-5*Q,ZH-7.5*Q,10,0),colorFF8595;
STICKLINE(OF=0 AND BACKSET(DW1,亏4[A1]*0.2) 0 AND 亏4[A1] 盈4[A1],ZH-7.5*Q,ZH-10*Q,10,0),colorFF8595;
STICKLINE(OF=0 AND BACKSET(DW1,亏1[A1]*0.2) 0 AND 亏1[A1] 盈1[A1],ZH-0*Q,ZH-0*Q,10,0),colorFFC8C8;
STICKLINE(OF=0 AND BACKSET(DW1,亏2[A1]*0.2) 0 AND 亏2[A1] 盈2[A1],ZH-2.5*Q,ZH-2.5*Q,10,0),colorFFC8C8;
STICKLINE(OF=0 AND BACKSET(DW1,亏[A1]*0.2) 0 AND 亏[A1] 盈[A1],ZH-5*Q,ZH-5*Q,10,0),colorFFC8C8;
STICKLINE(OF=0 AND BACKSET(DW1,亏4[A1]*0.2) 0 AND 亏4[A1] 盈4[A1],ZH-7.5*Q,ZH-7.5*Q,10,0),colorFFC8C8;
STICKLINE(OF=0 AND BACKSET(DW1,亏4[A1]*0.2) 0 AND 亏4[A1] 盈4[A1],ZH-10*Q,ZH-10*Q,10,0),colorFFC8C8;
PARTLINE(IF(OF=0,1,IF(OF=1,HM,1)),盈),LINETHICK2,colorFF;
PARTLINE(IF(OF=0,1,IF(OF=1,HM,1)),亏),LINETHICK2,colorFF0000;
STICKLINE(IF(OF=0,1,IF(OF=1,HM,1)) AND 盈,盈,0,0.1,0),colorFF44FF;
STICKLINE(IF(OF=0,1,IF(OF=1,HM,1)) AND 亏,亏,0,0.1,0),color777666;
STICKLINE(IF(OF=0,1,IF(OF=1,HM,1)) AND 盈 (亏),盈,0,0.1,0),colorFF44FF;
DRAWNUMBER(DW3,ZH-1*Q,M1[A1],2),ALIGN0,colorFFFFFF;
DRAWNUMBER(DW3,ZH-3.5*Q,M2[A1],2),ALIGN0,colorFFFFFF;
DRAWNUMBER(DW3,ZH-6*Q,M3[A1],2),ALIGN0,colorFFFFFF;
DRAWNUMBER(DW3,ZH-8.5*Q,M4[A1],2),ALIGN0,colorFFFFFF;
DRAWTEXT(OF=0 AND DW3,ZH-0*Q,'获利 '),ALIGN2,colorFFFFFF;
DRAWTEXT(OF=0 AND DW2,ZH-0*Q,'盈 '),ALIGN2,colorFF;
DRAWTEXT(OF=0 AND DW0,ZH-0*Q,'亏 '),ALIGN2,colorFF0000;
DRAWNUMBER(OF=0 AND DW2,ZH-1*Q,盈1[A1],0),colorFF;
DRAWNUMBER(OF=0 AND DW2,ZH-3.5*Q,盈2[A1],0),colorFF;
DRAWNUMBER(OF=0 AND DW2,ZH-6*Q,盈[A1],0),colorFF;
DRAWNUMBER(OF=0 AND DW2,ZH-8.5*Q,盈4[A1],0),colorFF;
DRAWNUMBER(OF=0 AND DW0,ZH-1*Q,亏1[A1],0),colorFF0000;
DRAWNUMBER(OF=0 AND DW0,ZH-3.5*Q,亏2[A1],0),colorFF0000;
DRAWNUMBER(OF=0 AND DW0,ZH-6*Q,亏[A1],0),colorFF0000;
DRAWNUMBER(OF=0 AND DW0,ZH-8.5*Q,亏4[A1],0),colorFF0000;
DRAWTEXT(X 0 AND DW4,CLOSE,'测试价'),ALIGN4,colorFFFFFF;
DRAWNUMBER(X 0 AND DW4,HIGH,Y,2),ALIGN4,PXDN30,colorFFFFFF;
DRAWTEXT(DW5,ZH-1*Q,NUMTOSTR(Q1,0)),color440000;
DRAWTEXT(DW5,ZH-3.5*Q,NUMTOSTR(N,0)),color440000;
DRAWTEXT(DW5,ZH-6*Q,NUMTOSTR(Q2,0)),color440000;
DRAWTEXT(DW5,ZH-8.5*Q,NUMTOSTR(Q3,0)),color440000;