下面这个指标是在K线的前二个高点横着画二条线,我改成三条线,就是增加一条(增加一个前三高)

原指标

N=6
HXA1:=REF(HIGH,N)=HHV(HIGH,2*N+1);
HXB1:=FILTER(HXA1,N);
HXC1:=BACKSET(HXB1,N+1);
HXD1:=FILTER(HXC1,N);
HXA2:=REF(LOW,N)=LLV(LOW,2*N+1);
HXB2:=FILTER(HXA2,N);
HXC2:=BACKSET(HXB2,N+1);
HXD2:=FILTER(HXC2,N);
HXE1:=(REF(LLV(LOW,2*N),1)+REF(HHV(HIGH,2*N),1))/2;
HXE2:=(HIGH+LOW)/2;
HXH1:=(HXD1 AND NOT(HXD2 AND HXE1>=HXE2)) OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
HXH2:=HXD1 AND NOT(HXD2 AND HXE1>=HXE2);
HXL1:=HXD2 AND NOT(HXD1 AND HXE1=HXE2);
HXX1:=REF(BARSLAST(HXH1),1)+1;
HXF1:=BACKSET(HXH1 AND COUNT(HXL1,HXX1)>0,LLVBARS(IF(HXL1,LOW,10000),HXX1));
HXG1:=HXF1>REF(HXF1,1);
HXI1:=BACKSET(HXG1,2);
HXLD:=HXI1>REF(HXI1,1);
HXL2:=HXLD OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
HXX2:=REF(BARSLAST(HXL2),1)+1;
HXF2:=BACKSET(HXL2 AND COUNT(HXH2,HXX2)>0,HHVBARS(IF(HXH2,HIGH,0),HXX2));
HXG2:=HXF2>REF(HXF2,1);
HXI2:=BACKSET(HXG2,2);
HXHD:=HXI2>REF(HXI2,1);
UU:=BACKSET(BARSTATUS=2,BARSLAST(HXLD)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(HXLD),1)+2);
XX:=WW>REF(WW,1);
UU2:=BACKSET(BARSTATUS=2,BARSLAST(HXHD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HXHD),1)+2);
XX2:=WW2>REF(WW2,1);
前一高:REF(H,BARSLAST(VV2)),COLORBLUE,DOTLINE;
前二高:REF(H,BARSLAST(XX2)),COLORBLUE,DOTLINE;

 

现指标

N:=6;
HXA1:=REF(HIGH,N)=HHV(HIGH,2*N+1);
HXB1:=FILTER(HXA1,N);
HXC1:=BACKSET(HXB1,N+1);
HXD1:=FILTER(HXC1,N);
HXA2:=REF(LOW,N)=LLV(LOW,2*N+1);
HXB2:=FILTER(HXA2,N);
HXC2:=BACKSET(HXB2,N+1);
HXD2:=FILTER(HXC2,N);
HXE1:=(REF(LLV(LOW,2*N),1)+REF(HHV(HIGH,2*N),1))/2;
HXE2:=(HIGH+LOW)/2;
HXH1:=(HXD1 AND NOT(HXD2 AND HXE1>=HXE2)) OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
HXH2:=HXD1 AND NOT(HXD2 AND HXE1>=HXE2);
HXL1:=HXD2 AND NOT(HXD1 AND HXE1=HXE2);
HXX1:=REF(BARSLAST(HXH1),1)+1;
HXF1:=BACKSET(HXH1 AND COUNT(HXL1,HXX1)>0,LLVBARS(IF(HXL1,LOW,10000),HXX1));
HXG1:=HXF1>REF(HXF1,1);
HXI1:=BACKSET(HXG1,2);
HXLD:=HXI1>REF(HXI1,1);
HXL2:=HXLD OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
HXX2:=REF(BARSLAST(HXL2),1)+1;
HXF2:=BACKSET(HXL2 AND COUNT(HXH2,HXX2)>0,HHVBARS(IF(HXH2,HIGH,0),HXX2));
HXG2:=HXF2>REF(HXF2,1);
HXI2:=BACKSET(HXG2,2);
HXHD:=HXI2>REF(HXI2,1);
UU2:=BACKSET(BARSTATUS=2,BARSLAST(HXHD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HXHD),1)+2);
XX2:=WW2>REF(WW2,1);
WW3:=BACKSET(VV2,REF(BARSLAST(HXHD),2)+30);
XX3:=WW3>REF(WW3,1);

前一高:REF(H,BARSLAST(VV2)),COLORBLUE,DOTLINE;
前二高:REF(H,BARSLAST(XX2)),COLORff00ff,DOTLINE;
前三高:REF(H,BARSLAST(XX3)),COLOR00ffff,DOTLINE;

 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。