私暮机构研究
DRAWGBK(C,COLORRGB(25,15,0),COLORRGB(10,160,0),1);
收:=INDEXC;
开:=INDEXO;
高:=INDEXH;
低:=INDEXL;
Var1:=YEAR=1990 AND MONTH=12 AND DAY=19;
Var2:=BARSLAST(Var1);
Var3:=IF(Var2>=0,REF(CLOSE,Var2)*收/REF(收,Var2),0);
Var4:=IF(Var2>=0,开/收*Var3,0);
Var5:=IF(Var2>=0,高/收*Var3,0);
Var6:=IF(Var2>=0,低/收*Var3,0);
STICKLINE(Var3>Var4 OR Var3=Var4 AND Var3>=REF(Var3,1),Var6,Var5, 0.1, 0),COLOR333399;
STICKLINE(Var3>Var4 OR Var3=Var4 AND Var3>=REF(Var3,1),Var3,Var4,7,0),COLOR333399;
x2:STICKLINE(Var3<Var4 OR Var3=Var4 AND Var3<REF(Var3,1),Var6,Var5,0.1,0),COLOR339933;
STICKLINE(Var3<Var4 OR Var3=Var4 AND Var3<REF(Var3,1),Var3,Var4,7,0),COLOR339933;
A:=C/6;
外轨上:=0.6*A+EMA(C,20);
内轨上:=0.4*A+EMA(C,20);
内轨下:=(-0.4*A)+EMA(C,20);
外轨下:=(-0.6*A)+EMA(C,20);
ar0:=EMA(C,20);
强弱线:STICKLINE(ar0>=REF(ar0,1),ar0,ar0,6,0),COLORMAGENTA;
STICKLINE(ar0<REF(ar0,1),ar0,ar0,6,0),COLORFFFFFF;
ar1:="ezstock@IS_LASTBAR";
DRAWTEXT(C>0 AND ar1=1,0.5*A+EMA(C,20),'←超买区'),COLORYELLOW;
DRAWTEXT(C>0 AND ar1=1,(-0.5*A)+EMA(C,20),'←超卖区'),COLORGREEN;
超买区:STICKLINE(C>0,外轨上,内轨上,0,0),COLORBBBBBB;
超卖区:STICKLINE(C>0,外轨下,内轨下,0,0),COLORBBBBBB;
STICKLINE(C>=O,C,O,8,0),COLOR0022FF;
STICKLINE(C>=O,H,L,1,0),COLOR0022FF;
STICKLINE(C>=O,C,O,5,0),COLOR0066FF;
STICKLINE(C>=O,C,O,3,0),COLOR0099FF;
STICKLINE(C>=O,C,O,1.5,0),COLOR00DDFF;
STICKLINE(C>=O,H,L,0,0),COLOR00DDFF;
STICKLINE(C<=O,C,O,8,0),COLORFF2200;
STICKLINE(C<=O,H,L,1,0),COLORFF2200;
STICKLINE(C<=O,C,O,5,0),COLORFF6600;
STICKLINE(C<=O,C,O,3,0),COLORFF9900;
STICKLINE(C<=O,C,O,1.5,0),COLORFFDD00;
STICKLINE(C<=O,H,L,0,0),COLORFFDD00;
RSV1:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9));
RSV2:=(RSV1-0.5)/5*EMA(C,20);
RSVK:=SMA(RSV2,3,1);
RSVD:=SMA(RSVK,3,1);
RSVJ:=RSVK*3-RSVD*2;
K:RSVK+EMA(C,20),COLORWHITE;
D:RSVD+EMA(C,20),COLORYELLOW;
J:RSVJ+EMA(C,20),COLORRED,LINETHICK2;
zf:=(c/ref(c,4)-1)*100;
s:='z:'+NUMTOSTR(zf[SYSPARAM(1)],2);
DRAWTEXT(BARPOS=SYSPARAM(1),h,s) ALIGN4;
drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4;
dd:="xh-z.dd"(16);
gg:="xh-z.gg"(16);
z:=dd*L+gg*h;
gd:=gg+dd;
p:=SYSPARAM(1);
sgd:=sum(gd,0);
gds:=sgd[p]-sgd+1;
sb:=if(gds<1,1,gds);
sa:=(sb<ref(sb,1))*sb;
hb:=hhv((sa=1)*BARPOS,0);
q:=hb[p];
wgd:=ref(barslast(gd),1)+1;
DRAWICON(gd,gg*h+dd*L,12);
hgd:=if(gg,h,if(dd,L,0));
Lgd:=if(gg,ref(L,wgd),if(dd,ref(h,wgd),0));
yhL:=(hgd-Lgd)/4;
oo:=CROSS(BACKSET(q=BARPOS,wgd[q]+1),0.5);{画箱体横线}
DRAWLINE(oo,Lgd[q]+2*yhl[q],q=BARPOS,Lgd[q]+2*yhl[q],0),POINTDOT,ColorFFCA95;
DRAWLINE(oo,Lgd[q]+4*yhl[q],q=BARPOS,Lgd[q]+4*yhl[q],0),POINTDOT,ColorFFCA95;
DRAWLINE(oo,Lgd[q],q=BARPOS,Lgd[q],0),POINTDOT,ColorFFCA95;
{画箱体竖线}
STICKLINE(oo or q=BARPOS,Lgd[q],hgd[q],0.01,0),POINTDOT,ColorFFCA95;
{画斜线1}
qz:=(wgd[q]);
wdg:=sumbars(gd,2);
k1:=(Lgd[q]-hgd[q])/qz*2,LINETHICK0,Color74AFFF;
g1:hgd[q]+(wdg-1)*k1,LINETHICK0,Color74AFFF;
DRAWSL(oo,hgd[q],k1,0,0),POINTDOT,Color74AFFF;
k2:=(Lgd[q]-hgd[q])/qz,LINETHICK0,Color74AFFF;
g2:hgd[q]+(wdg-1)*k2,LINETHICK0,colorred;
DRAWSL(oo,hgd[q],k2,0,0),Color74AFFF,LINETHICK2;
k3:=(Lgd[q]-hgd[q])/qz/2,LINETHICK0,Color74AFFF;
g3:hgd[q]+(wdg-1)*k3,LINETHICK0,Color74AFFF;
DRAWSL(oo,hgd[q],k3,0,0),POINTDOT,Color74AFFF;
k4:=(Lgd[q]-hgd[q])/qz/4,LINETHICK0,Color74AFFF;
g4:hgd[q]+(wdg-1)*k4,LINETHICK0,Color74AFFF;
DRAWSL(oo,hgd[q],k4,0,0),POINTDOT,Color74AFFF;
//DRAWSL(oo,hgd[q],(Lgd[q]-hgd[q])/qz*3,0,0),POINTDOT,Color74AFFF;
//DRAWSL(oo,hgd[q],(Lgd[q]-hgd[q])/qz*4,0,0),POINTDOT,Color74AFFF;
//DRAWSL(oo,hgd[q],(Lgd[q]-hgd[q])/qz*8,0,0),POINTDOT,Color74AFFF;
{画斜线2}
i1:=(hgd[q]-Lgd[q])/qz*2,LINETHICK0,ColorFF6FB7;
d1:Lgd[q]+(wdg-1)*i1,LINETHICK0,ColorFF6FB7;
DRAWSL(oo,Lgd[q],i1,0,0),POINTDOT,ColorFF6FB7;
i2:=(hgd[q]-Lgd[q])/qz,LINETHICK0,Color74AFFF;
d2:Lgd[q]+(wdg-1)*i2,LINETHICK0,colorgreen;
DRAWSL(oo,Lgd[q],i2,0,0),ColorFF6FB7,LINETHICK2;
i3:=(hgd[q]-Lgd[q])/qz/2,LINETHICK0,ColorFF6FB7;
d3:Lgd[q]+(wdg-1)*i3,LINETHICK0,ColorFF6FB7;
DRAWSL(oo,Lgd[q],i3,0,0),POINTDOT,ColorFF6FB7;
i4:=(hgd[q]-Lgd[q])/qz/4,LINETHICK0,ColorFF6FB7;
d4:Lgd[q]+(wdg-1)*i4,LINETHICK0,ColorFF6FB7;
DRAWSL(oo,Lgd[q],i4,0,0),POINTDOT,ColorFF6FB7;
//DRAWSL(oo,Lgd[q],(hgd[q]-Lgd[q])/qz*3,0,0),POINTDOT,ColorFF6FB7;
//DRAWSL(oo,Lgd[q],(hgd[q]-Lgd[q])/qz*4,0,0),POINTDOT,ColorFF6FB7;
//DRAWSL(oo,Lgd[q],(hgd[q]-Lgd[q])/qz*8,0,0),POINTDOT,ColorFF6FB7;
f:=f>0 or (f=0 and c>ref(c,1));{画K线}
STICKLINE(f,h,l,0.1,0),Color5151FF;
STICKLINE(f,c,o,8,1),Color5151FF;
STICKLINE(not(f),h,l,0.1,0)COLORCYAN;
STICKLINE(not(f),o,c,8,0)COLORCYAN;
xK:='斜率K\n'+'K1\n'+'±'+NUMTOSTR(abs(K1)*100,3)+' \nK2\n'+'±'
+NUMTOSTR(abs(K2)*100,3)+' \nK3\n'+'±'+NUMTOSTR(abs(K3)*100,3)
+' \nK4\n'+'±'+NUMTOSTR(abs(K4)*100,3);
DRAWTEXT(BARPOS=SYSPARAM(3)-5,H,XK),Color74AFFF,ALIGN4; |