百分比:=5;右数峰序:=2;
波谷值:=CONST(TROUGH(2,百分比,1)),NODRAW;{前M个ZIG转向波谷值}
波谷值1:=CONST(TROUGH(2,百分比,2)),NODRAW;
波谷值2:=CONST(TROUGH(2,百分比,3)),NODRAW;
波谷值3:=CONST(TROUGH(2,百分比,4)),NODRAW;
波谷值4:=CONST(TROUGH(2,百分比,5)),NODRAW;
波谷距离:= 1+CONST(TROUGHBARS(2,百分比,1)),NODRAW;{前M个ZIG转向波谷到当前距离}
波谷距离1:= 1+CONST(TROUGHBARS(2,百分比,2)),NODRAW;
波谷距离2:= 1+CONST(TROUGHBARS(2,百分比,3)),NODRAW;
波谷距离3:= 1+CONST(TROUGHBARS(2,百分比,4)),NODRAW;
波谷距离4:= 1+CONST(TROUGHBARS(2,百分比,5)),NODRAW;
波峰值:=CONST(PEAK(1,百分比,右数峰序));
波峰值1:=CONST(PEAK(1,百分比,3));
波峰值2:=CONST(PEAK(1,百分比,4));
波峰值3:=CONST(PEAK(1,百分比,5));
波峰值4:=CONST(PEAK(1,百分比,6));
N:=0.001;
XG:=ABS(波峰值-波谷值)<=N {AND BARSCOUNT(V)>60};
XG1:=ABS(波峰值1-波谷值1)<=N {AND BARSCOUNT(V)>60};
XG2:=ABS(波峰值2-波谷值2)<=N {AND BARSCOUNT(V)>60};
XG3:=ABS(波峰值3-波谷值3)<=N {AND BARSCOUNT(V)>60};
XG4:=ABS(波峰值4-波谷值4)<=N {AND BARSCOUNT(V)>60};
波峰距离:= 1+CONST(PEAKBARS(1,百分比,右数峰序)),NODRAW;
BFJL:=1+CONST(PEAKBARS(1,百分比,3)),NODRAW;
BFJL1:=1+CONST(PEAKBARS(1,百分比,4)),NODRAW;
BFJL2:=1+CONST(PEAKBARS(1,百分比,5)),NODRAW;
BFJL3:=1+CONST(PEAKBARS(1,百分比,6)),NODRAW;
距离:=CURRBARSCOUNT;
JZX0:=DRAWLINE(距离=1+CONST(TROUGHBARS(2,百分比,2)) AND XG,波谷值,距离=1,波谷值,1),COLORWHITE;
精准点:=(ABS(H-波谷值)<=N OR ABS(L-波谷值)<=N) {AND 距离<=120};
精准点1:=(ABS(H-波谷值1)<=N OR ABS(L-波谷值1)<=N);
精准点2:=(ABS(H-波谷值2)<=N OR ABS(L-波谷值2)<=N);
精准点3:=(ABS(H-波谷值3)<=N OR ABS(L-波谷值3)<=N);
精准点4:=(ABS(H-波谷值4)<=N OR ABS(L-波谷值4)<=N);
STICKLINE(精准点,波谷值,波谷值,3,1),COLORWHITE;
DRAWTEXT(精准点,波谷值*1,'1'),COLORYELLOW;
DRAWTEXT(精准点1,波谷值1*1,'2'),COLORYELLOW;
DRAWTEXT(精准点2,波谷值2*1,'3'),COLORYELLOW;
DRAWTEXT(精准点3,波谷值3*1,'4'),COLORYELLOW;
DRAWTEXT(精准点4,波谷值4*1,'5'),COLORYELLOW;
底1:=DRAWLINE(精准点1,波谷值,精准点,波谷值,1),COLORWHITE;
底2:=DRAWLINE(精准点2,波谷值1,精准点1,波谷值1,1),COLORWHITE;
底3:=DRAWLINE(精准点3,波谷值2,精准点2,波谷值2,1),COLORWHITE;
底4:=DRAWLINE(精准点4,波谷值3,精准点3,波谷值3,1),COLORWHITE;
精准点0:=(ABS(H-波峰值)<=N OR ABS(L-波峰值)<=N) {AND 距离<=120};
精准点A:=(ABS(H-波峰值1)<=N OR ABS(L-波峰值1)<=N);
精准点B:=(ABS(H-波峰值2)<=N OR ABS(L-波峰值2)<=N);
精准点C:=(ABS(H-波峰值3)<=N OR ABS(L-波峰值3)<=N);
精准点D:=(ABS(H-波峰值4)<=N OR ABS(L-波峰值4)<=N);
STICKLINE(精准点0,波峰值,波峰值,3,1),COLORWHITE;
DRAWTEXT(精准点0,波峰值*1.02,'A'),COLORMAGENTA;
DRAWTEXT(精准点A,波峰值1*1.02,'B'),COLORMAGENTA;
DRAWTEXT(精准点B,波峰值2*1.02,'C'),COLORMAGENTA;
DRAWTEXT(精准点C,波峰值3*1.02,'D'),COLORMAGENTA;
DRAWTEXT(精准点D,波峰值4*1.02,'E'),COLORMAGENTA;
顶1:=DRAWLINE(精准点A,波峰值,精准点0,波峰值,1),COLORWHITE;
顶2:=DRAWLINE(精准点B,波峰值1,精准点A,波峰值1,1),COLORWHITE;
顶3:=DRAWLINE(精准点C,波峰值2,精准点B,波峰值2,1),COLORWHITE;
顶4:=DRAWLINE(精准点D,波峰值3,精准点C,波峰值3,1),COLORWHITE;
假阴:=C<O AND C>REF(C,1);
STICKLINE(假阴,OPEN,CLOSE,3,0),COLORBLUE;
长阳短柱:=C/REF(C,1)>=1.04 AND V<HHV(V,60)/1.9;
STICKLINE(长阳短柱,OPEN,CLOSE,3,0),COLORYELLOW; |