指标1:
rc:=DYNAINFO(3);q:=datacount;hh:=DYNAINFO(5);LL:=DYNAINFO(6);
f:=max(hh-rc,rc-LL);ff:=f/rc*100;q2h:=if(ff<1,0.9797*rc,rc-2*f*1.016);
q2l:=if(ff<1,0.9697*rc,rc-3*f*1.011);FILLRGN(1,q2h,q2l),colorblack;
cz:=(q2h-q2l)/6;q2l,POINTDOT,,COLORWHITE;q2l+cz,POINTDOT,color0000cc;
q2l+2*cz,POINTDOT,color0000cc;q2l+3*cz,POINTDOT,color0000cc;
q2l+4*cz,POINTDOT,color0000cc;q2l+5*cz,POINTDOT,color0000cc;
a1:="macd.diff";a2:="macd.dea";a3:="macd.macd";
a4:="rsi.rsi1";a5:="rsi.rsi2";
mh:=hhv(max(a1,a3),0);mL:=LLv(min(a3,a1),0);
ch:=hhv(max(a4,a5),0);cL:=LLv(min(a5,a4),0);
mc:=(q2h-q2l)/(cH[q]-cL[q]);
mg:=(q2h+q2l-mc*(cH[q]+cL[q]))/2;
mb:=(q2h-q2l)/(mH[q]-mL[q]);
my:=(q2h+q2l-mb*(mH[q]+mL[q]))/2;
diff:a1*mb+my,COLORWHITE;dea:a2*mb+my,COLORYELLOW;macd:=a3*mb+my;
STICKLINE(macd>my,my,macd,1,1),COLORRED;
STICKLINE(macd<my,my,macd,1,1),COLOR00FF00;
obv:a4*mc+mg,COLORFFEE00;
k1:=hhv(h,0);k2:=llv(l,0);k3:=barslast(OPENMINUTES(TIME)<=240);
t1:=barslast(OPENMINUTES(TIME)<=60);
DRAWSL(OPENMINUTES(TIME)>=60,ref(k1,t1),0,k3,2),LINEDOT;
DRAWSL(OPENMINUTES(TIME)>=60,ref(k2,t1),0,k3,2),LINEDOT;
DRAWICON(OPENMINUTES(TIME)>60 and cross(c,ref(k1,t1)+0.001),ref(k1,t1),1);
PK:=VOL*(OPEN+CLOSE+HIGH+LOW)/4;PK1:=IF(VOL>0,PK/VOL,(OPEN+CLOSE+HIGH+LOW)/4);
C11:=PK1;A01:=(C11-LLV(C11,75))/(HHV(C11,75)-LLV(C11,75));
A11:=SMA(A01,13,1);A21:=SMA(A11,13,1);A31:=3*A11-2*A21;A41:=2*A31-0.5;
ZS:=DYNAINFO(3)*0.95;选a:=C11*(1-(A41-A21)/40);
选b:=CROSS(C11,选a) AND CLOSE/REF(CLOSE,1)<1.03;
选:IF(选b,ZS*1.03,ZS),colorFF00;
指标2:
zq:=DATATYPE;r1:=OPENMINUTES(TIME);zs:=ref(c,r1);zsr:=DYNAINFO(3);
j:=SUM(C*V,SUMBARS(VOL,CAPITAL))/SUM(V,SUMBARS(VOL,CAPITAL));
jj:=SUM(C*V,0)/SUM(V,0);jj1:=SUM(C*V,r1)/SUM(V,r1);
jja:=if(zq=6,jj,if(zq=1,jj1,jj));zsa:=if(zq=6,zsr,if(zq=1,zs,zsr));
cr:=if(zq=6,c>0,if(zq=1,r1>1,c>0));PARTLINE(cr,zsa),COLORGRAY,POINTDOT;
dk:=(SMA(C,2,1)-SMA(C,6,1))*2.1;
STICKLINE(dk>0and jja>0 ,zsa,ZSa+dk,0.1,0),Color5050FF;
STICKLINE(dk<=0and jja>0 ,zsa,ZSa+dk,0.1,0),ColorCyan;
if datatype>=0 then exit;
rc:=DYNAINFO(3);q:=datacount;hh:=DYNAINFO(5);LL:=DYNAINFO(6);
f:=max(hh-rc,rc-LL);ff:=f/rc*100;
q1h:=if(ff<1,0.9898*rc,rc-f*1.02);
q1l:=if(ff<1,0.9798*rc,rc-2*f*1.016);
FILLRGN(1,q1h,q1l),colorblack;
R:=INDEXC;Rh:=hhv(r,0);RL:=LLv(r,0);Rb:=(q1h-q1l)/(RH[q]-RL[q]);
Ry:=(q1h+q1l-rb*(RH[q]+RL[q]))/2;r*rb+ry,COLORFF00FF;
(SUM(r*INDEXV,r)/SUM(INDEXV,r))*rb+ry,COLOR00FF00;
流通:=FINANCE(7)/10000;
qj1:=CAPITAL/800; qj2:=CAPITAL/1000; qj3:=CAPITAL/1500; qj4:=CAPITAL/2000; qj5:=CAPITAL/4000; qj6:=CAPITAL/6000; qj7:=CAPITAL/8000; qj8:=CAPITAL/10000;qj9:=ESTDATA(8)/13000;
XS:=IF(CAPITAL<1,qj9,IF(流通<1,qj1,IF(流通>=1 AND 流通<5,qj2,IF(流通>=5 AND 流通<10,qj3,IF(流通>=10 AND 流通<20,qj4,IF(流通>=20 AND 流通<40,qj5,IF(流通>=40 AND 流通<60,qj6,IF(流通>=60 AND 流通<=100,qj7,IF(流通>=100,qj8,0)))))))));
XS1:=XS*1.618;
主动买入:=SUM(BUYVOL,0);主动卖出:=SUM(SELLVOL,0);特单买:=IF(BUYVOL>XS1,BUYVOL,0);
特单卖:=IF(SELLVOL>XS1,SELLVOL,0);大单买:=IF(BUYVOL>XS and BUYVOL<=XS1,BUYVOL,0);
大单卖:=IF(SELLVOL>XS and SELLVOL<=XS1,SELLVOL,0);小单买:=IF(BUYVOL<=XS,BUYVOL,0);
小单卖:=IF(SELLVOL<=XS,SELLVOL,0);特单买入:=SUM(特单买,0);特单卖出:=SUM(特单卖,0);
大单买入:=SUM(大单买,0);大单卖出:=SUM(大单卖,0);小单买入:=SUM(小单买,0);小单卖出:=SUM(小单卖,0);
大单差:=(特单买入+大单买入)-(特单卖出+大单卖出);
k1:=hhv(h,0);k2:=llv(l,0);k3:=barslast(OPENMINUTES(TIME)<=240);
t1:=barslast(OPENMINUTES(TIME)<=60);
DRAWSL(OPENMINUTES(TIME)>=60,ref(k1,t1),0,k3,2),LINEDOT;
DRAWSL(OPENMINUTES(TIME)>=60,ref(k2,t1),0,k3,2),LINEDOT;
DRAWICON(OPENMINUTES(TIME)>60 and cross(c,ref(k1,t1)+0.001),ref(k1,t1),1);
VARA:=IF(BUYVOL<=REF(ASKVOL(1),1)+REF(ASKVOL(2),1)+REF(ASKVOL(3),1) AND CLOSE>=REF(ASKPRICE(3),1),BUYVOL,0);
上扫单:=SUM(INTPART(IF(VARA>XS AND VARA<XS1,BUYVOL,0)),0);
VARB:=IF(SELLVOL<=REF(BIDVOL(1),1)+REF(BIDVOL(2),1)+REF(BIDVOL(3),1) AND CLOSE<=REF(BIDPRICE(3),1),SELLVOL,0);
下扫单:=SUM(INTPART(IF(VARB>XS AND VARA<XS1,SELLVOL,0)),0);
总:=(特单买入+特单卖出+大单买入+大单卖出+小单买入+小单卖出+上扫单+下扫单);
DRAWTEXTEX(DYNAINFO(7),1,20,20,'■ 大单买: '+NUMTOSTR(特单买入,0)),LINETHICK2,colorFF;
DRAWTEXTEX(DYNAINFO(7),1,260,20,'占:'+NUMTOSTR(FLOOR(特单买入/总*100),0)+' %'),LINETHICK2,colorFF;
DRAWTEXTEX(DYNAINFO(7),1,20,80,'■ 大单卖: '+NUMTOSTR(特单卖出,0)),LINETHICK2,colorFF00;
DRAWTEXTEX(DYNAINFO(7),1,260,80,'占:'+NUMTOSTR(FLOOR(特单卖出/总*100),0)+' %'),LINETHICK2,colorFF00;
DRAWTEXTEX(DYNAINFO(7),1,20,140,'■ 中单买: '+NUMTOSTR(大单买入,0)),LINETHICK2,colorFF;
DRAWTEXTEX(DYNAINFO(7),1,260,140,'占:'+NUMTOSTR(FLOOR(大单买入/总*100),0)+' %'),LINETHICK2,colorFF;
DRAWTEXTEX(DYNAINFO(7),1,20,200,'■ 中单卖: '+NUMTOSTR(大单卖出,0)),LINETHICK2,colorFF00;
DRAWTEXTEX(DYNAINFO(7),1,260,200,'占:'+NUMTOSTR(FLOOR(大单卖出/总*100),0)+' %'),LINETHICK2,colorFF00;
DRAWTEXTEX(DYNAINFO(7),1,20,260,'■ 小单买: '+NUMTOSTR(小单买入,0)),LINETHICK2,colorFF00FF;
DRAWTEXTEX(DYNAINFO(7),1,260,260,'占:'+NUMTOSTR(FLOOR(小单买入/总*100),0)+' %'),LINETHICK2,colorFF00FF;
DRAWTEXTEX(DYNAINFO(7),1,20,320,'■ 小单卖: '+NUMTOSTR(小单卖出,0)),LINETHICK2,colorFFFF00;
DRAWTEXTEX(DYNAINFO(7),1,260,320,'占:'+NUMTOSTR(FLOOR(小单卖出/总*100),0)+' %'),LINETHICK2,colorFFFF00;
DRAWTEXTEX(DYNAINFO(7),1,20,380,'■ 上扫单: '+NUMTOSTR(上扫单,0)),LINETHICK2,colorFF;
DRAWTEXTEX(DYNAINFO(7),1,260,380,'占:'+NUMTOSTR(FLOOR(上扫单/总*100),0)+' %'),LINETHICK2,colorFFFF00;
DRAWTEXTEX(DYNAINFO(7),1,20,440,'■ 下扫单: '+NUMTOSTR(下扫单,0)),LINETHICK2,colorFFFF00;
DRAWTEXTEX(DYNAINFO(7),1,260,440,'占:'+NUMTOSTR(FLOOR(下扫单/总*100),0)+' %'),LINETHICK2,colorFFFF00;
DRAWTEXTEX(DYNAINFO(7),1,20,500,'■ 大单差: '+NUMTOSTR(大单差,0)),LINETHICK2,colorFF00;
DRAWTEXTEX(DYNAINFO(7),1,260,500,'占:'+NUMTOSTR(大单差/(大单买入+大单卖出)*100,0)+' %'),LINETHICK2,colorFF00;
DRAWTEXTEX(DYNAINFO(7),1,20,560,'■ 多空差: '+NUMTOSTR((主动买入-主动卖出),0)),LINETHICK2,colorFFFF;
DRAWTEXTEX(DYNAINFO(7),1,260,560,'占:'+NUMTOSTR((主动买入-主动卖出)/总*100,0)+' %'),LINETHICK2,colorFFFF; |