3. 趋势线
drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4;
z:=zig(4,n);p:=SYSPARAM(1);
dd:="xh-z.dd"(n); wd:=barslast(dd);
sd:=sum(dd,0); di:=sd[p]-sd+1; id:=(di<ref(di,1))*di;
gg:="xh-z.gg"(n); wg:=barslast(gg);
sg:=sum(gg,0); gi:=sg[p]-sg+1; ig:=(gi<ref(gi,1))*gi;
td0:=barslast(di[p]=id);
td1:=barslast(1+di[p]=id);
td2:=barslast(2+di[p]=id);
x:ref(z,td0),POINTDOT;
k1:(x-ref(z,td1))/ref(td1,td0)*100,LINETHICK0,COLORGREEN;
k3:(ref(z,td1)-ref(z,td2))/ref(td2,td1)*100,LINETHICK0,Color5E7159;
x1:x+td0*k1/100,LINETHICK0,COLORGREEN;
x2:ref(z,td1)+td1*k3/100,LINETHICK0,Color5E7159;
DRAWLINE(1+di[p]=id,z,di[p]=id,z,1),COLORGREEN;
DRAWLINE(2+di[p]=id,z,1+di[p]=id,z,1),Color5E7159,POINTDOT;
tg0:=barslast(gi[p]=ig);
tg1:=barslast(1+gi[p]=ig);
tg2:=barslast(2+gi[p]=ig);
s:ref(z,tg0),POINTDOT;
k2:(s-ref(z,tg1))/ref(tg1,tg0)*100,LINETHICK0,COLORMAGENTA;
k4:(ref(z,tg1)-ref(z,tg2))/ref(tg2,tg1)*100,LINETHICK0,Color546C82;
s1:s+tg0*k2/100,LINETHICK0,COLORMAGENTA;
s2:ref(z,tg1)+tg1*k4/100,LINETHICK0,Color546C82;
DRAWLINE(1+gi[p]=ig,z,gi[p]=ig,z,1),COLORMAGENTA;
DRAWLINE(2+gi[p]=ig,z,1+gi[p]=ig,z,1),Color546C82,POINTDOT;
DRAWICON((dd and di<5) or (gg and gi<5),z,12);
DRAWICON(di[p]=id or gi[p]=ig,z,10);
N=16; M=0;
4. 速阻线
drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4;
dd:="xh-z.dd"(n);
gg:="xh-z.gg"(n);
z:=dd*L+gg*h;
gd:=gg+dd;
DRAWICON(dd,z,12);
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,dd*L+gg*h,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);{定点}
qz:=(wgd[q])*4/3;{画斜线1}
w:=sumbars(gd,2)-1;
K1:=(hgd[q]-Lgd[q])/qz*4/3,LINETHICK0;
d1:ref(z,w)+k1*w,LINETHICK0,ColorFF6FB7;
K2:=(hgd[q]-Lgd[q])/qz/1.123,LINETHICK0;
d2:ref(z,w)+k2*w,LINETHICK0,ColorFF6FB7;
K3:=(hgd[q]-Lgd[q])/qz/2.246,LINETHICK0;
d3:ref(z,w)+k3*w,LINETHICK0,ColorFF6FB7;
DRAWSL(oo,Lgd[q],k1,0,0),LINETHICK1,ColorFF6FB7;
DRAWSL(oo,Lgd[q],k2,0,0),POINTDOT,ColorFF6FB7;
DRAWSL(oo,Lgd[q],k3,0,0),POINTDOT,ColorFF6FB7;
{画斜线2}
b1:=(Lgd[q]-hgd[q])/qz*4/3,LINETHICK0;
g1:ref(hgd[q],w)+b1*w,LINETHICK0,Color74AFFF;
b2:=(Lgd[q]-hgd[q])/qz/1.132,LINETHICK0;
g2:ref(hgd[q],w)+b2*w,LINETHICK0,Color74AFFF;
b3:=(Lgd[q]-hgd[q])/qz/2.246,LINETHICK0;
g3:ref(hgd[q],w)+b3*w,LINETHICK0,Color74AFFF;
DRAWSL(oo,hgd[q],b1,0,0),Color74AFFF,LINETHICK1;
DRAWSL(oo,hgd[q],b2,0,0),POINTDOT,Color74AFFF;
DRAWSL(oo,hgd[q],b3,0,0),POINTDOT,Color74AFFF;
i1:='斜率\nk1\n'+'±'+NUMTOSTR(abs(k1)*100,3)+'\nk2\n'+'±'
+NUMTOSTR(abs(k2)*100,3)+'\nk3\n'+'±'+NUMTOSTR(abs(k3)*100,3);
DRAWTEXT(BARPOS=SYSPARAM(3)-3,h,i1),ALIGN4,SHIFT1,Color74AFFF;
;N=16
5. 圆弧
drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4;
gg:="xh-z.gg"(ng);
dd:="xh-z.dd"(nd);
p:=SYSPARAM(1);
z:=gg*h+dd*L;
sd:=sum(dd,0);
sdd:=sd[p]-sd+1;
wx1:=barssince(sdd=3);
wx2:=barssince(sdd=2);
wx3:=barssince(sdd=1);
ry1:=hhv((wx1=0)*z,0);
ry2:=hhv((wx2=0)*z,0);
ry3:=hhv((wx3=0)*z,0);
rx2:=hhv((wx2=0)*wx1,wx1+1);
rx3:=hhv((wx3=0)*wx1,wx1+1);
x2:=rx2[p];
x3:=rx3[p];
y1:=ry1[p];
y2:=(ry2[p]-ry1[p]);
y3:=(ry3[p]-ry1[p]);
xy:=POW(x2,2)+POW(y2,2);
e:=(x3*xy/x2-(x3*x3+y3*y3))/(y3-x3*y2/x2);
d:=-(y2*e+xy)/x2;
y1:=POW((d*d+e*e)/4-POW((wx1+d/2),2),0.5);
y2:=-POW((d*d+e*e)/4-POW((wx1+d/2),2),0.5);
c1:=ref(L,wx1)-ref(y1,wx1);
yy:=(y1+c1);
c2:=ref(L,wx1)+ref(y1,wx1);
ye:=(y2+c2);
wyy:=abs(ref(yy,wx3)-ref(z,wx3))<0.01;
wye:=abs(ref(ye,wx3)-ref(z,wx3))<0.01;
if wyy[datacount] then
yy,LINETHICK2,COLORMAGENTA;
ELSE
ye,LINETHICK2,COLORMAGENTA;
sg:=sum(gg,0);
sgg:=sg[p]-sg+1;
wxg1:=barssince(sgg=3);
wxg2:=barssince(sgg=2);
wxg3:=barssince(sgg=1);
ryg1:=hhv((wxg1=0)*z,0);
ryg2:=hhv((wxg2=0)*z,0);
ryg3:=hhv((wxg3=0)*z,0);
rxg2:=hhv((wxg2=0)*wxg1,wxg1+1);
rxg3:=hhv((wxg3=0)*wxg1,wxg1+1);
xg2:=rxg2[p];
xg3:=rxg3[p];
yg1:=ryg1[p];
yg2:=(ryg2[p]-ryg1[p]);
yg3:=(ryg3[p]-ryg1[p]);
xyg:=POW(xg2,2)+POW(yg2,2);
eg:=(xg3*xyg/xg2-(xg3*xg3+yg3*yg3))/(yg3-xg3*yg2/xg2);
g:=-(yg2*eg+xyg)/xg2;
yg1:=POW((g*g+eg*eg)/4-POW((wxg1+g/2),2),0.5);
yg2:=-POW((g*g+eg*eg)/4-POW((wxg1+g/2),2),0.5);
cg1:=ref(z,wxg1)-ref(yg1,wxg1);
yyg:=(yg1+cg1);
cg2:=ref(z,wxg1)+ref(yg1,wxg1);
yeg:=(yg2+cg2);
wyyg:=abs(ref(yyg,wxg3)-ref(z,wxg3))<0.01;
wyeg:=abs(ref(yeg,wxg3)-ref(z,wxg3))<0.01;
if wyyg[datacount] then
yyg,LINETHICK2,COLORGREEN;
ELSE
yeg,LINETHICK2,COLORGREEN;
DRAWICON(dd,z,11);
DRAWICON(gg,z,10);
ND=16; NG=16
转一个千钧老师的数浪公式【千钧数浪】
说明:
一般数浪公式是,总结性大于预测性,不要过分相信它!
事后看看玩玩可以,而且都有之字转向函数。
{K线}
STICKLINE(CLOSE>OPEN or CLOSE=OPEN and CLOSE>REF(CLOSE,1),LOW,HIGH,0.1,0),colorred;
STICKLINE(CLOSE>OPEN or CLOSE=OPEN and CLOSE>REF(CLOSE,1),OPEN,CLOSE,7,0),colorred;
STICKLINE(CLOSE<OPEN or CLOSE=OPEN and CLOSE<=REF(CLOSE,1),LOW,HIGH,0.1,0),colorcyan;
STICKLINE(CLOSE<OPEN or CLOSE=OPEN and CLOSE<=REF(CLOSE,1),OPEN,CLOSE,7,0),colorcyan;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,0,0 ),COLOR00FF00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,8,0 ),COLOR008800;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,7,0 ),COLOR009900;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,6,0 ),COLOR00AA00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,5,0 ),COLOR00BB00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,4,0 ),COLOR00CC00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3,0 ),COLOR00DD00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2,0 ),COLOR00EE00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1,0 ),COLOR00FF00;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0,0) ,COLORFFBBFF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,8,0) ,COLORFF00FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,7,0) ,COLORFF22FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6,0) ,COLORFF44FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,5,0) ,COLORFF66FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0) ,COLORFF88FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0) ,COLORFF99FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0) ,COLORFFAAFF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1,0) ,COLORFFBBFF;
pl5:=zig(3,5);
en1:=zig(3,5)>ref(zig(3,5),1) and ref(zig(3,5),1)<=ref(zig(3,5),2) and ref(zig(3,5),2)<=ref(zig(3,5),3);
ex1:=zig(3,5)<ref(zig(3,5),1) and ref(zig(3,5),1)>=ref(zig(3,5),2) and ref(zig(3,5),2)>=ref(zig(3,5),3);
pl10:=zig(3,13);
en2:=zig(3,10)>ref(zig(3,10),1) and ref(zig(3,10),1)<=ref(zig(3,10),2) and ref(zig(3,10),2)<=ref(zig(3,10),3);
ex2:=zig(3,10)<ref(zig(3,10),1) and ref(zig(3,10),1)>=ref(zig(3,10),2) and ref(zig(3,10),2)>=ref(zig(3,10),3);
pl20:=zig(3,26);
en3:=zig(3,20)>ref(zig(3,20),1) and ref(zig(3,20),1)<=ref(zig(3,20),2) and ref(zig(3,20),2)<=ref(zig(3,20),3);
ex3:=zig(3,20)<ref(zig(3,20),1) and ref(zig(3,20),1)>=ref(zig(3,20),2) and ref(zig(3,20),2)>=ref(zig(3,20),3);
pl40:=zig(3,55);
走强1:=barslast(pl5<ref(pl5,1));
走弱1:=barslast(pl5>ref(pl5,1));
走强2:=barslast(pl10<ref(pl10,1));
走弱2:=barslast(pl10>ref(pl10,1));
走强3:=barslast(pl20<ref(pl20,1));
走弱3:=barslast(pl20>ref(pl20,1));
ztjz5:=if(pl10>ref(pl10,1),count(en1,走强2),0);
ztjd5:=if(pl10>ref(pl10,1),count(ex1,走强2),0);
dtjz5:=if(pl10<ref(pl10,1),count(en1,走弱2),0);
dtjd5:=if(pl10<ref(pl10,1),count(ex1,走弱2),0);
ztjz10:=if(pl20>ref(pl20,1),count(en2,走强3),0);
ztjd10:=if(pl20>ref(pl20,1),count(ex2,走强3),0);
dtjz10:=if(pl20<ref(pl20,1),count(en2,走弱3),0);
dtjd10:=if(pl20<ref(pl20,1),count(ex2,走弱3),0);
drawtext(en1 and dtjz5=1,l*0.98,'(Ⅰ)'),colorffff00;
drawtext(ex1 and dtjd5=2,h*1.02,'(Ⅱ)'),colorffff00;
drawtext(en2 and ztjz5=1,l*0.98,'(Ⅲ)'),colorffff00;
drawtext(ex1 and pl10>ref(pl10,1) and ztjd5=1,h*1.02,'⑴'),colorff;
drawtext(en1 and pl10>ref(pl10,1) and ztjz5=2,l*0.98,'⑵'),colorff;
drawtext(ex1 and pl10>ref(pl10,1) and ztjz5=2,h*1.02,'⑶'),colorff;
drawtext(en1 and pl10>ref(pl10,1) and ztjz5=3,l*0.98,'⑷'),colorff;
drawtext(ex2 and pl20>ref(pl20,1) and ztjd10=1,h*1.02,'⑸'),colorff;
drawtext(en2 and dtjz10=1,l*0.94,'【A】'),color00ff00;
drawtext(ex2 and dtjd10=2,h*1.03,'【B】'),color00ff00;
drawtext(en3 and ztjz10=1,l*0.94,'【C】'),color00ff00;
drawtext(ex2 and pl20>ref(pl20,1) and ztjd10=1,h*1.04,'①'),Linethick3,colorffff;
drawtext(en2 and pl20>ref(pl20,1) and ztjz10=2,l*0.94,'②'),Linethick3,colorffff;
drawtext(ex2 and pl20>ref(pl20,1) and ztjd10=2 or (ztjd10=0 or ztjd10=2) and ex2,h*1.04,'③'),Linethick3,colorffff;
drawtext(en2 and pl20>ref(pl20,1) and ztjz10=3,l*0.94,'④'),Linethick3,colorffff;
DMLJ:=HHV(H,120);