您现在的位置:程序化交易>> 期货公式>> 博易大师>> 博易大师知识>>正文内容

修改技术指标 [博易POBO]

咨询内容:

修改技术指标

N1:=10;
N2:=10;
DISP:=2;
K:=1/10;
P1:=PEAK(H,10,1,1);
P2:=PEAK(H,10,2,1);
WP1:=PEAKBARS(H,10,1,1);
WP2:=PEAKBARS(H,10,2,1);
T111:=TROUGH(L,10,1,1);
T2:=TROUGH(L,10,2,1);
WT111:=TROUGHBARS(L,10,1,1);
WT2:=TROUGHBARS(L,10,2,1);
TJ1:=P1>T111 AND P2>T2 ;
ZD:=MAX(T111,T2);
ZG:=MIN(P1,P2);
LL:=MIN(T111,T2);
HH:=MAX(P1,P2);
TJ2:=FILTER(ZG>ZD,2);
TJ3:=ZG=REF(ZG,BARSLAST(TJ2)) OR ZD=REF(ZD,BARSLAST(TJ2));
TJ4:=TJ1&&TJ2&&NOT(TJ3);
TJ5:=BETWEEN(ZD,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));
TJ6:=BETWEEN(ZG,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));
TJ7:=ZG>REF(ZG,REF(BARSLAST(TJ4),1))&&ZD<REF(ZD,REF(BARSLAST(TJ4),1));
TJ8:=TJ4&&NOT(TJ5 OR TJ6 OR TJ7);
ZSD:=IF(TJ8,ZD,NULL);
ZSG:=IF(TJ8,ZG,NULL);
ZSH:=IF(TJ8,HH,NULL);
ZSL:=IF(TJ8,LL,NULL);
STICKLINE1(TJ8,ZSH,ZSL,0,-1),COLORMAGENTA;
STICKLINE1(TJ8,ZSD,ZSG,0,1),COLORMAGENTA;
DRAWTEXT(DISP=2,ZSH,'中枢'),COLORRED;
POLYLINE1(DISP=2,REF(ZSD,BARSLAST(TJ8))),CROSSDOT,COLORLIGHTRED;
POLYLINE1(DISP=2,REF(ZSG,BARSLAST(TJ8))),CROSSDOT,COLORLIGHTGREEN;
POLYLINE1(DISP=2,REF(ZSH,BARSLAST(TJ8))),POINTDOT,COLORRED;
POLYLINE1(DISP=2,REF(ZSL,BARSLAST(TJ8))),POINTDOT,COLORGREEN;
POLYLINE1(DISP=3,ZIGZAG(H,10,1)),COLORLIGHTBLUE;
POLYLINE1(DISP=3,ZIGZAG(L,10,1)),COLORLIGHTBLUE;
局部低点预选A:=BACKSET(LLV(L,5)<REF(LLV(L,4),1),4);
局部低点预选B:=BACKSET(局部低点预选A=0 AND REF(局部低点预选A,1)=1,2);
局部低点预选C:=IF(局部低点预选B=1 AND REF(局部低点预选B,1)=0,-1,0);
局部高点预选A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4);
局部高点预选B:=BACKSET(局部高点预选A=0 AND REF(局部高点预选A,1)=1,2);
局部高点预选C:=IF(局部高点预选B=1 AND REF(局部高点预选B,1)=0,1,0);
缺口判断:=IF(L>REF(H,1),1,IF(H<REF(L,1),-1,0));
距前高天:=BARSLAST(局部高点预选C=1);
距前低天:=BARSLAST(局部低点预选C=-1);
小值周期:=LLVBARS(L,20);
大值周期:=HHVBARS(H,20);
低保留AA:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);
低保留AB:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR LLV(L,距前低天+2)<REF(LLV(L,距前低天+1),1)),-1,0);
低保留S:=IF((低保留AA=-1 OR 低保留AB=-1) AND L<REF(H,距前高天+1),-1,0);
预判:=IF((距前低天<4 AND HHV(缺口判断,距前低天)<>1) OR REF(低保留S,距前低天)=0,1,0);
判断:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND 预判=1 AND 大值周期>REF(小值周期,距前低天+1) AND 大值周期>REF(小值周期,距前低天) AND 大值周期>REF(大值周期,距前高天),1,0);
高保留A:=IF(局部高点预选C=1 AND REF(距前低天,1)>REF(距前高天,1) AND HHV(H,距前低天+1)>REF(HHV(H,距前低天+1),1),1,0);
高保留B:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND REF(低保留S,距前低天)=-1 AND (距前低天>=4 OR HHV(缺口判断,距前低天)=1),1,0);
高保留:=IF((高保留A=1 OR 高保留B=1 OR 判断=1) AND H>REF(L,距前低天+1),1,0);
预判A:=IF((距前高天<4 AND HHV(缺口判断,距前高天)<>1) OR REF(高保留,距前高天)=0,1,0);
判断A:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND 预判A=1 AND 小值周期>REF(大值周期,距前高天+1) AND 小值周期>REF(大值周期,距前高天) AND 小值周期>REF(小值周期,距前低天),-1,0);
低保留A:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);
低保留B:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR 判断A=-1),-1,0);
低保留:=IF((低保留A=-1 OR 低保留B=-1) AND L<REF(H,距前高天+1),-1,0);
距前高天A:=BARSLAST(高保留=1);
距前低天A:=BARSLAST(低保留=-1);
预判X:=IF((距前低天A<4 AND HHV(缺口判断,距前低天A)<>1) OR REF(低保留,距前低天A)=0,1,0);
判断X:=IF(局部高点预选C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND 预判X=1 AND 大值周期>REF(小值周期,距前低天A+1) AND 大值周期>REF(小值周期,距前低天A) AND 大值周期>REF(大值周期,距前高天A),1,0);
高保留XA:=IF(局部高点预选C=1 AND REF(距前低天A,1)>REF(距前高天A,1) AND HHV(H,距前低天A+1)>REF(HHV(H,距前低天A+1),1),1,0);
高保留XB:=IF(局部高点预选C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND REF(低保留,距前低天A)=-1 AND (距前低天A>=4 OR HHV(缺口判断,距前低天A)=1),1,0);
高保留X:=IF((高保留XA=1 OR 高保留XB=1 OR 判断X=1) AND H>REF(L,距前低天A+1),1,0);
预判XA:=IF((距前高天A<4 AND HHV(缺口判断,距前高天A)<>1) OR REF(高保留XA,距前高天A)=0,1,0);
判断XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND 预判XA=1 AND 小值周期>REF(大值周期,距前高天A+1) AND 小值周期>REF(大值周期,距前高天A) AND 小值周期>REF(小值周期,距前低天A),-1,0);
低保留XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)>REF(距前低天A,1) AND LLV(L,距前高天A+1)<REF(LLV(L,距前高天A+1),1),-1,0);
低保留XB:=IF(局部低点预选C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND (距前高天A>=4 OR LLV(缺口判断,距前高天A)=-1 OR 判断XA=-1),-1,0);
低保留X:=IF((低保留XA=-1 OR 低保留XB=-1) AND L<REF(H,距前高天A+1),-1,0);
距前高天YA:=BARSLAST(高保留X=1);
距前低天YA:=BARSLAST(低保留X=-1);
预判YX:=IF((距前低天YA<4 AND HHV(缺口判断,距前低天YA)<>1) OR REF(低保留X,距前低天YA)=0,1,0);
判断YX:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND 预判YX=1 AND 大值周期>REF(小值周期,距前低天YA+1) AND 大值周期>REF(小值周期,距前低天YA) AND 大值周期>REF(大值周期,距前高天YA),1,0);
高保留YXA:=IF(局部高点预选C=1 AND REF(距前低天YA,1)>REF(距前高天YA,1) AND HHV(H,距前低天YA+1)>REF(HHV(H,距前低天YA+1),1),1,0);
高保留YXB:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND REF(低保留X,距前低天YA)=-1 AND (距前低天YA>=4 OR HHV(缺口判断,距前低天YA)=1),1,0);
高保留YX:=IF((高保留YXA=1 OR 高保留YXB=1 OR 判断YX=1) AND H>REF(L,距前低天YA+1),1,0);
预判YXA:=IF((距前高天YA<4 AND HHV(缺口判断,距前高天YA)<>1) OR REF(高保留YXA,距前高天YA)=0,1,0);
判断YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND 预判YXA=1 AND 小值周期>REF(大值周期,距前高天YA+1) AND 小值周期>REF(大值周期,距前高天YA) AND 小值周期>REF(小值周期,距前低天YA),-1,0);
低保留YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)>REF(距前低天YA,1) AND LLV(L,距前高天YA+1)<REF(LLV(L,距前高天YA+1),1),-1,0);
低保留YXB:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND (距前高天YA>=4 OR LLV(缺口判断,距前高天YA)=-1 OR 判断YXA=-1),-1,0);
低保留YX:=IF((低保留YXA=-1 OR 低保留YXB=-1) AND L<REF(H,距前高天YA+1),-1,0);
AAAD:=IF(高保留YX=1 AND 低保留YX=-1 AND H>REF(H,REF(距前高天YA,1)+2),1,IF(高保留YX=1 AND 低保留YX=-1 AND L<REF(L,REF(距前低天YA,1)+2),-1,0));
极点保留:=IF(AAAD=0,高保留YX+低保留YX,AAAD);
局部极点:IF(极点保留=-1,L,IF(极点保留=1,H,NULL)), CIRCLEDOT ,COLORYELLOW;
DRAWLINE3(极点保留=-1,HHV(H,SUMBARS(极点保留=-1,2)-1),HHVBARS(H,SUMBARS(极点保留=-1,2)-1),极点保留=1,LLV(L,SUMBARS(极点保留=1,2)-1),LLVBARS(L,SUMBARS(极点保留=1,2)-1),0),COLORYELLOW;
DRAWLINE3(极点保留=1,LLV(L,SUMBARS(极点保留=1,2)-1),LLVBARS(L,SUMBARS(极点保留=1,2)-1),极点保留=-1,HHV(H,SUMBARS(极点保留=-1,2)-1),HHVBARS(H,SUMBARS(极点保留=-1,2)-1),0),COLORRED;
DD1:=BARSLAST(ABS(极点保留)<>1);
DRAWTEXT(极点保留=1,局部极点,'卖'),COLORGREEN;
DRAWTEXT(极点保留=-1,局部极点,'买'),COLORRED;
MA5:MA(CLOSE,5),COLOR0000FF,LINETHICK2;
判:IF(MA5<REF(MA5,1),MA5,NULL),COLOR00FF00,LINETHICK2;

HHX:=BACKSET(极点保留=-1,1+HHVBARS(H,SUMBARS(极点保留=-1,2)-1));
DRAWHORIZONTALLINE(CROSS(HHX=1,0.5),H,COLORYELLOW);
LLX:=BACKSET(极点保留=1,1+LLVBARS(L,SUMBARS(极点保留=1,2)-1));
DRAWHORIZONTALLINE(CROSS(LLX=1,0.5),L,COLORGREEN);
 DRAWCOLORKLINE(ISUP,COLORRED,1);
DRAWCOLORKLINE(ISDOWN,COLORCYAN,1);
DRAWCOLORKLINE(ISEQUAL,COLORWHITE,1);
收盘:CLOSE,PRECIS0;
剩余天:HISEXPDAYS,PRECIS0,NODRAW;
到期日:HISEXPDATE,PRECIS0,NODRAW;
涨跌:CLOSE-REF(CLOSE,1),NODRAW,PRECIS1;
涨幅:涨跌/REF(CLOSE,1)*100,NODRAW;
变动价位:MINPRICE,NODRAW,PRECIS1;
变动价格:变动价位*UNIT,NODRAW,PRECIS1;
//动态黄金分割率
//DRAWKLINE(0.5,COLORRED,1,COLORCYAN,1);
G:=MA(C,5);
DY:=MA(C,10);
NNH:=BARSLAST(H=HHV(H,15)),NODRAW;
NNL:=BARSLAST(L=LLV(L,15)),NODRAW;
NN:=IF(REF(G,NNH)>REF(DY,NNH) AND NNH<=12,NNH,IF(REF(G,NNL)<REF(DY,NNL) AND NNL<=12,NNL,13)),NODRAW;
YN:=IF(ISLASTBAR AND NN>0,NN,13),NODRAW;
HHY:=REF(H,YN)=HHV(H,14);
LLY:=REF(L,YN)=LLV(L,14);
FG01:=BACKSET(HHY,YN+1)>BACKSET(HHY,YN),NODRAW;//只设置前面第6个
FD01:=BACKSET(LLY,YN+1)>BACKSET(LLY,YN),NODRAW;
FG02:=FG01=FD01 AND G>DY,NODRAW;
FD02:=FG01=FD01 AND G<DY,NODRAW;
TTTT:=BARSLAST(FD01),NODRAW;
FG0:=FG01 AND IF(FG02=1,H=HHV(H,BARSLAST(REF(FD01,1))+1),H=HHV(H,IF(BARSLAST(L=LLV(L,7))>=5,5,BARSLAST(FD01)))) AND FD02=0,NODRAW;
FD0:=FD01 AND IF(FD02=1,L=LLV(L,BARSLAST(REF(FG01,1))+1),L=LLV(L,IF(BARSLAST(H=HHV(L,7))>=5,5,BARSLAST(FG01)))) AND FG02=0,NODRAW;
GT:=BARSLAST(FG0),NODRAW;
DT:=BARSLAST(FD0),NODRAW;
LLLL:=DT=0 AND REF(DT,1)<GT AND L>REF(L,REF(DT,1)+1),NODRAW;
FG1:=BACKSET(REFX(GT,1)=0 AND GT<DT AND REFX(H,1)>=REF(H,GT),GT+1),NODRAW;
FD1:=BACKSET(REFX(DT,1)=0 AND DT<GT AND REFX(L,1)<=REF(L,DT),DT+1),NODRAW;
FG11:=IF(GT=0 AND REF(GT,1)<DT AND IF(REF(G,BARSLAST(L=LLV(L,7)))>REF(DY,BARSLAST(L=LLV(L,7))),BARSLAST(L=LLV(L,7))<5,1) AND H<REF(H,REF(GT,1)+1),1,0),NODRAW;
FD11:=IF(DT=0 AND REF(DT,1)<GT AND IF(REF(G,BARSLAST(H=HHV(H,7)))<REF(DY,BARSLAST(H=HHV(H,7))),BARSLAST(H=HHV(H,7))<5,1) AND L>REF(L,REF(DT,1)+1),1,0),NODRAW;
GT1:=BARSLAST(FG11<>1 AND FG1<>1 AND FG0),NODRAW;
DT1:=BARSLAST(FD11<>1 AND FD1<>1 AND FD0),NODRAW;
FD2:=BACKSET(REFX(GT1,1)=0 AND DT1<3 AND GT1-DT1<4 AND REF(L,DT1)>LLV(L,GT1+5),DT1+1),NODRAW;
FG2A:=BACKSET(REFX(GT1,1)=0 AND DT1<3 AND GT1-DT1<4 AND REF(L,DT1)<=LLV(L,GT1+5) AND REF(H,GT1)>HHV(H,GT1+5),GT1+1),NODRAW;
FG2B:=IF(GT1=0 AND DT1<4 AND REF(GT1,1)-DT1<4 AND REF(L,DT1)<=LLV(L,REF(GT1,1)+6) AND H>HHV(H,REF(GT1,1)+6),1,0),NODRAW;
FG2:=BACKSET(REFX(DT1,1)=0 AND GT1<3 AND DT1-GT1<4 AND REF(H,GT1)<HHV(H,DT1+5),GT1+1),NODRAW;
FD2AC:=BACKSET(REFX(DT1,1)=0 AND GT1<3 AND DT1-GT1<4 AND REF(H,GT1)>=HHV(L,DT1+5) AND REF(L,DT1)>LLV(L,DT1+5),DT1+1),NODRAW;
FD2B:=IF(DT1=0 AND GT1<4 AND REF(DT1,1)-GT1<4 AND REF(H,GT1)>=HHV(H,REF(DT1,1)+6) AND L>LLV(L,REF(DT1,1)+6),1,0),NODRAW;
TTTTTT:= H<REF(H,REF(GT1,1)+1) AND DT1<4,NODRAW;
HHHHHH:=REF(LLV(L,10),DT1),NODRAW;
FG21:=IF(GT1=0 AND DT1<4 AND H<=REF(H,REF(GT1,1)+1),1,0),NODRAW;
FD21:=IF(DT1=0 AND GT1<4 AND L>=REF(L,REF(DT1,1)+1),1,0),NODRAW;
FD231:=BACKSET(REFX(GT1,1)=0 AND DT1>3 AND GT1>DT1 AND GT1-DT1<4 AND REFX(H,1)>REF(H,GT1) AND REF(L,DT1)>REF(LLV(L,10),DT1),DT1+1),NODRAW;
FG23:=BACKSET(REFX(GT1,1)=0 AND DT1>3 AND GT1>DT1 AND  GT1-DT1<4 AND REFX(H,1)>REF(H,GT1) AND (REF(H,GT1)<REF(HHV(H,13),GT1) OR REF(FD231,DT1)=0),GT1+1),NODRAW;
FG231:=BACKSET(REFX(DT1,1)=0 AND GT1>3 AND DT1>GT1 AND DT1-GT1<4 AND REFX(L,1)<REF(L,DT1) AND REF(H,GT1)<REF(HHV(H,10),GT1),GT1+1),NODRAW;
FD23:=BACKSET(REFX(DT1,1)=0 AND GT1>3 AND DT1>GT1 AND DT1-GT1<4 AND REFX(L,1)<REF(L,DT1) AND ( REF(L,DT1)>REF(LLV(L,13),DT1) OR REF(FG231,GT1)=0),DT1+1),NODRAW;
FDD23:=REF(H,GT1)<REF(HHV(H,10),GT1) OR REF(FD23,DT1)=0,NODRAW;
FD24:=BACKSET(REFX(GT1,1)=0 AND DT1>3 AND GT1>DT1 AND GT1-DT1<4 AND REFX(H,1)<HHV(H,GT1+3) AND REF(L,DT1)>LLV(L,DT1+5),DT1+1),NODRAW;
FG24:=BACKSET(REFX(DT1,1)=0 AND GT1>3 AND DT1>GT1 AND DT1-GT1<4 AND REFX(L,1)>LLV(L,DT1+3) AND REF(H,GT1)<HHV(H,GT1+5),GT1+1),NODRAW;
GT2:=BARSLAST(FG21<>1 AND FG23<>1 AND FG231<>1 AND FG24<>1 AND FG2<>1 AND FG2A<>1 AND FG2B<>1 AND GT1=0),NODRAW;
DT2:=BARSLAST(FD21<>1 AND FD23<>1 AND FD231<>1 AND FD24<>1 AND FD2<>1 AND FD2AC<>1 AND FD2B<>1 AND DT1=0),NODRAW;
FG3:=BACKSET(REFX(GT2,1)=0 AND GT2<DT2 AND REFX(H,1)>=REF(H,GT2),GT2+1),NODRAW;
FD3:=BACKSET(REFX(DT2,1)=0 AND DT2<GT2 AND REFX(L,1)<=REF(L,DT2),DT2+1),NODRAW;
FG31:=IF(GT2=0 AND REF(GT2,1)<DT2 AND H<REF(H,REF(GT2,1)+1),1,0),NODRAW;
FD31:=IF(DT2=0 AND REF(DT2,1)<GT2 AND L>REF(L,REF(DT2,1)+1),1,0),NODRAW;
GT3:=BARSLAST(GT2=0 AND FG3<>1 AND FG31<>1),NODRAW;
DT3:=BARSLAST(DT2=0 AND FD3<>1 AND FD31<>1),NODRAW;
FG4:=BACKSET(REFX(GT3,1)=0 AND GT3<DT3 AND REFX(H,1)>=REF(H,GT3),GT3+1),NODRAW;
FD4:=BACKSET(REFX(DT3,1)=0 AND DT3<GT3 AND REFX(L,1)<=REF(L,DT3),DT3+1),NODRAW;
FG41:=IF(GT3=0 AND REF(GT3,1)<DT3 AND H<REF(H,REF(GT3,1)+1),1,0),NODRAW;
FD41:=IF(DT3=0 AND REF(DT3,1)<GT3 AND L>REF(L,REF(DT3,1)+1),1,0),NODRAW;
HHH:=GT3=0 AND FG31<>1 AND FG3<>1;
LLL:=DT3=0 AND FD31<>1 AND FD3<>1;
DRAWLINE1(HHH,H,LLL,L,0),COLORGREEN,DOT;
DRAWLINE1(LLL,L,HHH,H,0),COLORMAGENTA,DOT;
DX:=HHH>0||LLL>0;
AA:VALUEWHEN(HHH,H)-VALUEWHEN(LLL,L),PRECIS0,NODRAW,NOTEXT;
顶:=VALUEWHEN(HHH,H);
底:=VALUEWHEN(LLL,L);
H1:=VALUEWHEN(LLL,L)+AA*0.809;
H2:=VALUEWHEN(LLL,L)+AA*0.618;
H3:=VALUEWHEN(LLL,L)+AA*0.500;
H4:=VALUEWHEN(LLL,L)+AA*0.382;
H5:=VALUEWHEN(LLL,L)+AA*0.191;
XX:=BACKSET(ISLASTBAR,MAX(BARSLAST(HHH),BARSLAST(LLL))+6),ALIGN0,VALIGN2;
天:=REFX1(VALUEWHEN(HHH,H),9999);
地:=REFX1(VALUEWHEN(LLL,L),9999);
XX1:=REFX1(VALUEWHEN(LLL,L)+AA*0.809,9999);
XX2:=REFX1(VALUEWHEN(LLL,L)+AA*0.618,9999);
XX3:=REFX1(VALUEWHEN(LLL,L)+AA*0.500,9999);
XX4:=REFX1(VALUEWHEN(LLL,L)+AA*0.382,9999);
XX5:=REFX1(VALUEWHEN(LLL,L)+AA*0.191,9999);

DRAWSL(ISLASTBAR,顶,0,-MAX(BARSLAST(HHH),BARSLAST(LLL)),0,COLORGREEN);
DRAWNUMBER(CROSS(XX,0.5),天,天,0,COLORGREEN),ALIGN0,VALIGN1;
DRAWTEXT(ISLASTBAR,天,'顶'),ALIGN0,VALIGN1,COLORGREEN;
DRAWSL(ISLASTBAR,底,0,-MAX(BARSLAST(HHH),BARSLAST(LLL)),0,COLORMAGENTA);
DRAWNUMBER(CROSS(XX,0.5),地,地,0,COLORMAGENTA),ALIGN0,VALIGN1;
DRAWTEXT(ISLASTBAR,地,'底'),ALIGN0,VALIGN1,COLORMAGENTA;
DRAWSL(ISLASTBAR,H1,0,-MAX(BARSLAST(HHH),BARSLAST(LLL)),0,COLORLIGHTGREY);
DRAWNUMBER(CROSS(XX,0.5),XX1,XX1,0,COLORLIGHTGREY),ALIGN0,VALIGN1;
DRAWTEXT(ISLASTBAR,H1,' 0.191'),ALIGN0,VALIGN1,COLORLIGHTGREY;
DRAWSL(ISLASTBAR,H2,0,-MAX(BARSLAST(HHH),BARSLAST(LLL)),0,RGB(227,227,0));
DRAWNUMBER(CROSS(XX,0.5),XX2,XX2,0,RGB(227,227,0)),ALIGN0,VALIGN1;
DRAWTEXT(ISLASTBAR,H2,' 0.382'),ALIGN0,VALIGN1,RGB(227,227,0);
DRAWSL(ISLASTBAR,H3,0,-MAX(BARSLAST(HHH),BARSLAST(LLL)),0,COLORLIGHTGREY);
DRAWNUMBER(CROSS(XX,0.5),XX3,XX3,0,COLORLIGHTGREY),ALIGN0,VALIGN1;
DRAWTEXT(ISLASTBAR,H3,' 0.500'),ALIGN0,VALIGN1,COLORLIGHTGREY;
DRAWSL(ISLASTBAR,H4,0,-MAX(BARSLAST(HHH),BARSLAST(LLL)),0,RGB(227,227,0));
DRAWNUMBER(CROSS(XX,0.5),XX4,XX4,0,RGB(227,227,0)),ALIGN0,VALIGN1;
DRAWTEXT(ISLASTBAR,H4,' 0.618'),ALIGN0,VALIGN1,RGB(227,227,0);
DRAWSL(ISLASTBAR,H5,0,-MAX(BARSLAST(HHH),BARSLAST(LLL)),0,RGB(227,227,0));
DRAWNUMBER(CROSS(XX,0.5),XX5,XX5,0,RGB(227,227,0)),ALIGN0,VALIGN1;
DRAWTEXT(ISLASTBAR,H5,' 0.809'),ALIGN0,VALIGN1,RGB(227,227,0);
 M:=5;//M值需要大于等于5
D:=MA(C,10);
NNHA:=BARSLAST(H=HHV(H,M)),NODRAW;
NNLA:=BARSLAST(L=LLV(L,M)),NODRAW;
NNA:=IF(REF(G,NNHA)>REF(D,NNHA) AND NNHA<=M-3,NNHA,IF(REF(G,NNLA)<REF(D,NNLA) AND NNLA<=M-3,NNLA,M-2)) ,NODRAW;
NNNA:=IF(ISLASTBAR AND NNA>0,NNA,M-2) ,NODRAW;
H1A:=REF(H,NNNA)=HHV(H,M-1);
L1A:=REF(L,NNNA)=LLV(L,M-1);
FG01A:=BACKSET(H1A,NNNA+1)>BACKSET(H1A,NNNA),NODRAW;//只设置前面第M-1个
FD01A:=BACKSET(L1A,NNNA+1)>BACKSET(L1A,NNNA) ,NODRAW;
FG02A:=FG01A=FD01A AND G>D,NODRAW;
FD02A:=FG01A=FD01A AND G<D,NODRAW;
TTTTA:=BARSLAST(FD01A),NODRAW;
FG0A:=FG01A AND IF(FG02A=1,H=HHV(H,BARSLAST(REF(FD01A,1))+1),H=HHV(H,IF(BARSLAST(L=LLV(L,M))>=M-2,M-2,BARSLAST(FD01A)))) AND FD02A=0 ,NODRAW;
FD0A:=FD01A AND IF(FD02A=1,L=LLV(L,BARSLAST(REF(FG01A,1))+1),L=LLV(L,IF(BARSLAST(H=HHV(L,M))>=M-2,M-2,BARSLAST(FG01A))))  AND FG02A=0 ,NODRAW;
//高低点间周期
GTA:=BARSLAST(FG0A),NODRAW;
DTA:=BARSLAST(FD0A),NODRAW;
//第一次处理高低点间多余的点
LLLLA:=DTA=0 AND REF(DTA,1)<GTA AND L>REF(L,REF(DTA,1)+1),NODRAW;
FG1A:=BACKSET(REFX(GTA,1)=0 AND GTA<DTA AND REFX(H,1)>=REF(H,GTA),GTA+1),NODRAW;
FD1A:=BACKSET(REFX(DTA,1)=0 AND DTA<GTA AND REFX(L,1)<=REF(L,DTA),DTA+1),NODRAW;
FG11A:=IF(GTA=0 AND REF(GTA,1)<DTA AND IF(REF(G,BARSLAST(L=LLV(L,M)))>REF(D,BARSLAST(L=LLV(L,M))),BARSLAST(L=LLV(L,M))<M-2,1) AND  H<REF(H,REF(GTA,1)+1),1,0),NODRAW;
FD11A:=IF(DTA=0 AND REF(DTA,1)<GTA AND IF(REF(G,BARSLAST(H=HHV(H,M)))<REF(D,BARSLAST(H=HHV(H,M))),BARSLAST(H=HHV(H,M))<M-2,1) AND L>REF(L,REF(DTA,1)+1),1,0),NODRAW;
//再次周期
GT1A:=BARSLAST(FG11A<>1 AND FG1A<>1 AND FG0A),NODRAW;
DT1A:=BARSLAST(FD11A<>1 AND FD1A<>1 AND FD0A),NODRAW;
FD2A:=BACKSET(REFX(GT1A,1)=0 AND DT1A<3 AND GT1A-DT1A<4 AND REF(L,DT1A)>LLV(L,GT1A+M-2),DT1A+1),NODRAW;
FG2AA:=BACKSET(REFX(GT1A,1)=0 AND DT1A<3 AND GT1A-DT1A<4 AND REF(L,DT1A)<=LLV(L,GT1A+M-2) AND REF(H,GT1A)>HHV(H,GT1A+M-2),GT1A+1),NODRAW;
FG2BA:=IF(GT1A=0 AND DT1A<4 AND REF(GT1A,1)-DT1A<4 AND REF(L,DT1A)<=LLV(L,REF(GT1A,1)+M-1) AND H>HHV(H,REF(GT1A,1)+M-1),1,0),NODRAW;
FG2C:=BACKSET(REFX(DT1A,1)=0 AND GT1A<3 AND DT1A-GT1A<4 AND REF(H,GT1A)<HHV(H,DT1A+M-2),GT1A+1),NODRAW;
FD2AA:=BACKSET(REFX(DT1A,1)=0 AND GT1A<3 AND DT1A-GT1A<4 AND REF(H,GT1A)>=HHV(L,DT1A+M-2) AND REF(L,DT1A)>LLV(L,DT1A+M-2),DT1A+1),NODRAW;
FD2BA:=IF(DT1A=0 AND GT1A<4 AND REF(DT1A,1)-GT1A<4 AND REF(H,GT1A)>=HHV(H,REF(DT1A,1)+6) AND L>LLV(L,REF(DT1A,1)+M-1),1,0),NODRAW;
TTTTTTA:= H<REF(H,REF(GT1A,1)+1) AND DT1A<4,NODRAW;
HHHHHHA:=REF(LLV(L,10),DT1A),NODRAW;
//前长后短;
FG21A:=IF(GT1A=0 AND DT1A<4 AND H<=REF(H,REF(GT1A,1)+1)  ,1,0),NODRAW;
FD21A:=IF(DT1A=0 AND GT1A<4  AND L>=REF(L,REF(DT1A,1)+1) ,1,0),NODRAW;
//前短后长,前低后高(去低);
FD231A:=BACKSET(REFX(GT1A,1)=0 AND DT1A>3 AND GT1A>DT1A AND GT1A-DT1A<4 AND REFX(H,1)>REF(H,GT1A) AND REF(L,DT1A)>REF(LLV(L,10),DT1A),DT1A+1),NODRAW;
FG23A:=BACKSET(REFX(GT1A,1)=0 AND DT1A>3 AND GT1A>DT1A AND  GT1A-DT1A<4 AND REFX(H,1)>REF(H,GT1A) AND (REF(H,GT1A)<REF(HHV(H,13),GT1A) OR REF(FD231A,DT1A)=0),GT1A+1),NODRAW;
//前短后长,去2;
FG231A:=BACKSET(REFX(DT1A,1)=0 AND GT1A>3  AND DT1A>GT1A AND DT1A-GT1A<4 AND REFX(L,1)<REF(L,DT1A) AND REF(H,GT1A)<REF(HHV(H,10),GT1A) ,GT1A+1),NODRAW;
FD23A:=BACKSET(REFX(DT1A,1)=0 AND GT1A>3  AND DT1A>GT1A AND DT1A-GT1A<4 AND REFX(L,1)<REF(L,DT1A) AND ( REF(L,DT1A)>REF(LLV(L,13),DT1A) OR REF(FG231A,GT1A)=0),DT1A+1),NODRAW;
//前短后长,去3;
FDD23A:=REF(H,GT1A)<REF(HHV(H,10),GT1A) OR REF(FD23A,DT1A)=0,NODRAW;
FD24A:=BACKSET(REFX(GT1A,1)=0 AND DT1A>3 AND GT1A>DT1A AND GT1A-DT1A<4 AND REFX(H,1)<HHV(H,GT1A+3) AND REF(L,DT1A)>LLV(L,DT1A+5),DT1A+1),NODRAW;
FG24A:=BACKSET(REFX(DT1A,1)=0 AND GT1A>3  AND DT1A>GT1A AND DT1A-GT1A<4 AND REFX(L,1)>LLV(L,DT1A+3) AND REF(H,GT1A)<HHV(H,GT1A+5),GT1A+1),NODRAW;
//做两次高低点间多余的点
GT2A:=BARSLAST(FG21A<>1 AND FG23A<>1 AND FG231A<>1 AND FG24A<>1   AND FG2AA<>1 AND FG2AA<>1 AND FG2BA<>1 AND GT1A=0),NODRAW;
DT2A:=BARSLAST(FD21A<>1 AND FD23A<>1 AND FD231A<>1 AND FD24A<>1  AND FD2AA<>1 AND FD2AA<>1 AND FD2BA<>1 AND DT1A=0),NODRAW;
FG3A:=BACKSET(REFX(GT2A,1)=0 AND GT2A<DT2A AND REFX(H,1)>=REF(H,GT2A),GT2A+1),NODRAW;
FD3A:=BACKSET(REFX(DT2A,1)=0 AND DT2A<GT2A AND REFX(L,1)<=REF(L,DT2A),DT2A+1),NODRAW;
FG31A:=IF(GT2A=0 AND REF(GT2A,1)<DT2A AND H<REF(H,REF(GT2A,1)+1),1,0),NODRAW;
FD31A:=IF(DT2A=0 AND REF(DT2A,1)<GT2A AND L>REF(L,REF(DT2A,1)+1),1,0),NODRAW;
GT3A:=BARSLAST(GT2A=0 AND FG3A<>1 AND FG31A<>1 ),NODRAW;
DT3A:=BARSLAST(DT2A=0 AND  FD3A<>1 AND FD31A<>1),NODRAW;
FG4A:=BACKSET(REFX(GT3A,1)=0 AND GT3A<DT3A AND REFX(H,1)>=REF(H,GT3A),GT3A+1),NODRAW;
FD4A:=BACKSET(REFX(DT3A,1)=0 AND DT3A<GT3A AND REFX(L,1)<=REF(L,DT3A),DT3A+1),NODRAW;
FG41A:=IF(GT3A=0 AND REF(GT3A,1)<DT3A AND H<REF(H,REF(GT3A,1)+1),1,0),NODRAW;
FD41A:=IF(DT3A=0 AND REF(DT3A,1)<GT3A AND L>REF(L,REF(DT3A,1)+1),1,0),NODRAW;
HHHA:=GT3A=0 AND FG31A<>1 AND  FG3A<>1,NODRAW;
LLLA:=DT3A=0 AND FD31A<>1 AND  FD3A<>1,NODRAW;
DRAWLINE1(HHHA ,H,LLLA,L,0),COLORGREEN,LINETHICK1;//绿色
DRAWLINE1(LLLA,L,HHHA ,H,0),COLORMAGENTA,LINETHICK1;//红色
//最后一段画线
N1A:=BARSLAST(HHHA)+1;
N2A:=BARSLAST(LLLA)+1;
DRAWLINE3(ISLASTBAR&&MIN(N1A,N2A)=N2A&&L>REF(L,N2A-1),REF(L,N2A-1),N2A-1,ISLASTBAR,H,0,1),COLORMAGENTA,LINETHICK1;//红色
DRAWLINE3(ISLASTBAR&&MIN(N1A,N2A)=N1A&&H<REF(H,N1A-1),REF(H,N1A-1),N1A-1,ISLASTBAR,L,0,1),COLO     修改到这边使用

 

 来源:程序化99网( WWW.CXH99.COM )

博易技术人员: 具体怎么安装上也说一下吧   老师  刚用这个软件  不太熟悉  没有老师关注吗? 来源 程序化久久网

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信号:cxh99cxh99  进行 有偿收费 编写!

怎么收费,代编流程等详情请点击阅读!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容