ZR曲线
-
相关简介:{ZR曲线} input:ND(16,1,999),NG(16,1,999); DRAWTEXT(SYSPARAM(2)=BARPOS,CLOSE,'板块:'+BLKNAME),ALIGN4,colorCCFFFF; DD:=XH-Z.DD(ND); GG:=XH-Z.GG(NG); SD:=SUM(DD,0); P:=SYSPARAM(1); Q:=SYSPARAM(3); SDD:=SD[P]-SD+1; WX0:=BARSSINCE(SDD=4); WX1:=BARSSINCE(SDD=3
-
文章来源:择股网作者:股海网发布时间:2009-06-13浏览次数:
{ZR曲线}
input:ND(16,1,999),NG(16,1,999);
DRAWTEXT(SYSPARAM(2)=BARPOS,CLOSE,'板块:'+BLKNAME),ALIGN4,colorCCFFFF;
DD:="XH-Z.DD"(ND);
GG:="XH-Z.GG"(NG);
SD:=SUM(DD,0);
P:=SYSPARAM(1);
Q:=SYSPARAM(3);
SDD:=SD[P]-SD+1;
WX0:=BARSSINCE(SDD=4);
WX1:=BARSSINCE(SDD=3);
WX2:=BARSSINCE(SDD=2);
WX3:=BARSSINCE(SDD=1);
RX2:=HHV((WX2=0)*WX1,0);
X2:=RX2[P];
RX3:=HHV((WX3=0)*WX1,0);
X3:=RX3[P];
RY1:=HHV((WX1=0)*LOW,0);
Y1:=RY1[P];
RY2:=HHV((WX2=0)*LOW,0);
Y2:=RY2[P]-Y1;
RY3:=HHV((WX3=0)*LOW,0);
Y3:=RY3[P]-Y1;
XS:=POW(X3,0.5);
XE:=POW(X2,0.5);
K:=(XS*Y2-XE*Y3)/(XS*X2-XE*X3);
D:=(POW(Y2-K*X2,2))/X2;
YY1:=POW(D*WX1,0.5)+K*WX1;
R1:=Y1-REF(YY1,WX1);
YY:=YY1+R1;
YY2:=-POW(D*WX1,0.5)+K*WX1;
R2:=Y1-REF(YY2,WX1);
YE:=YY2+R2;
WYY:=ABS(REF(YY,WX3)-REF(LOW,WX3))<0.01;
WYE:=ABS(REF(YE,WX3)-REF(LOW,WX3))<0.01;
IF WYY[P] THEN
低:YY,LINETHICK2,colorFF00FF;ELSE
低1:YE,LINETHICK2,colorFF00FF;
SG:=SUM(GG,0);
SGG:=SG[P]-SG+1;
WXG0:=BARSSINCE(SGG=4);
WXG1:=BARSSINCE(SGG=3);
WXG2:=BARSSINCE(SGG=2);
WXG3:=BARSSINCE(SGG=1);
RXG2:=HHV((WXG2=0)*WXG1,0);
XG2:=RXG2[P];
RXG3:=HHV((WXG3=0)*WXG1,0);
XG3:=RXG3[P];
RYG1:=HHV((WXG1=0)*HIGH,0);
YG1:=RYG1[P];
RYG2:=HHV((WXG2=0)*HIGH,0);
YG2:=RYG2[P]-YG1;
RYG3:=HHV((WXG3=0)*HIGH,0);
YG3:=RYG3[P]-YG1;
XSG:=POW(XG3,0.5);
XEG:=POW(XG2,0.5);
KG:=(XSG*YG2-XEG*YG3)/(XSG*XG2-XEG*XG3);
G:=(POW(YG2-KG*XG2,2))/XG2;
YYG1:=POW(G*WXG1,0.5)+KG*WXG1;
RG1:=YG1-REF(YYG1,WXG1);
YYG:=YYG1+RG1;
YYG2:=-POW(G*WXG1,0.5)+KG*WXG1;
RG2:=YG1-REF(YYG2,WXG1);
YEG:=YYG2+RG2;
WYYG:=ABS(REF(YYG,WXG3)-REF(HIGH,WXG3))<0.01;
WYEG:=ABS(REF(YEG,WXG3)-REF(HIGH,WXG3))<0.01;
IF WYYG[P] THEN
高:YYG,LINETHICK2,color89FF50;ELSE
高1:YEG,LINETHICK2,color89FF50;
DRAWICON(WX0>=0 AND (DD OR GG),DD*LOW+GG*HIGH,12);
DRAWICON(WX3=0 OR WXG3=0,DD*LOW+GG*HIGH,10);
TT:='高\n \n'+NUMTOSTR(IF(WYYG[P],YYG[Q],YEG),3)+'\n \n \n \n 低\n \n'+NUMTOSTR(IF(WYY[P],YY[Q],YE[Q]),3);
DRAWTEXT(BARPOS=Q-5,HIGH,TT),ALIGN4,SHIFT1;
{ZR圆弧}
input:ND(16,1,99),NG(16,1,99);
DRAWTEXT(SYSPARAM(2)=BARPOS,CLOSE,'板块:'+BLKNAME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YG2[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,colorFF00;ELSE
YEG,LINETHICK2,colorFF00;
DRAWICON(DD,Z,11);
DRAWICON(GG,Z,10);
{XH-Z}{zig-分段信号}
input:N(20,1,100);
Z:=ZIG(4,N);
F:=Z-REF(Z,1);
D:=FILTER(REFX(F>0 AND REF(F,1)<0,1) OR BARPOS=1,2);
WD:=BARSLAST(D);
G:=FILTER(REFX(F<0 AND REF(F,1)>0,1) OR BARPOS=1,2);
WG:=BARSLAST(G);
XWD:=IF(SUM(WD=0,2)>1,1,WD);
XWG:=IF(SUM(WG=0,2)>1,1,WG);
FD:=HHV(HIGH,XWD)/REF(LOW,XWD)-1>N/100;
FG:=1-LLV(LOW,XWG)/REF(HIGH,XWG)>N/100;
DQZ:=BACKSET(ISLASTBAR AND WD<WG AND FD=0,XWD+1)=0;
GQZ:=BACKSET(ISLASTBAR AND WG<WD AND FG=0,XWD+1)=0;
DD:DQZ*D OR BARPOS=1;
GG:GQZ*G OR BARPOS=1;