老师好,麻烦老师将最后两行的数字能够表达出来,谢谢。 [博易POBO]
咨询内容:
G:=MA(C,5);
D:=MA(C,10);
NNH:=BARSLAST(H=HHV(H,M)) ,NODRAW;
NNL:=BARSLAST(L=LLV(L,M)) ,NODRAW;
NN:=IF(REF(G,NNH)>REF(D,NNH) AND NNH<=M-3,NNH,IF(REF(G,NNL)<REF(D,NNL) AND NNL<=M-3,NNL,M-2)) ,NODRAW;
NNN:=IF(ISLASTBAR AND NN>0,NN,M-2) ,NODRAW;
H1:=REF(H,NNN)=HHV(H,M-1);
L1:=REF(L,NNN)=LLV(L,M-1);
FG01:=BACKSET(H1,NNN+1)>BACKSET(H1,NNN),NODRAW;//只设置前面第M-1个
FD01:=BACKSET(L1,NNN+1)>BACKSET(L1,NNN) ,NODRAW;
FG02:=FG01=FD01 AND G>D,NODRAW;
FD02:=FG01=FD01 AND G<D,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,M))>=M-2,M-2,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,M))>=M-2,M-2,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,M)))>REF(D,BARSLAST(L=LLV(L,M))),BARSLAST(L=LLV(L,M))<M-2,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,M)))<REF(D,BARSLAST(H=HHV(H,M))),BARSLAST(H=HHV(H,M))<M-2,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+M-2),DT1+1),NODRAW;
FG2A:=BACKSET(REFX(GT1,1)=0 AND DT1<3 AND GT1-DT1<4 AND REF(L,DT1)<=LLV(L,GT1+M-2) AND REF(H,GT1)>HHV(H,GT1+M-2),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)+M-1) AND H>HHV(H,REF(GT1,1)+M-1),1,0),NODRAW;
FG2:=BACKSET(REFX(DT1,1)=0 AND GT1<3 AND DT1-GT1<4 AND REF(H,GT1)<HHV(H,DT1+M-2),GT1+1),NODRAW;
FD2A:=BACKSET(REFX(DT1,1)=0 AND GT1<3 AND DT1-GT1<4 AND REF(H,GT1)>=HHV(L,DT1+M-2) AND REF(L,DT1)>LLV(L,DT1+M-2),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)+M-1),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;
//前短后长,去2;
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;
//前短后长,去3;
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 FD2A<>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,NODRAW;
LLL:=DT3=0 AND FD31<>1 AND FD3<>1,NODRAW;
DRAWNUMBER(REFX(HHH,1),REFX(H,1),BARSLAST(LLL)+1,0,COLORCYAN),ALIGN2,VALIGN2,FONTSIZE22;
DRAWNUMBER(REFX(LLL,1),REFX(L,1),BARSLAST(HHH)+1,0,COLORWHITE),ALIGN2,VALIGN0,FONTSIZE22;
DRAWCOLORKLINE(LLL,COLORYELLOW,0); M:=5;//M值需要大于等于5
G:=MA(C,5);
D:=MA(C,10);
NNH:=BARSLAST(H=HHV(H,M)),NODRAW;
NNL:=BARSLAST(L=LLV(L,M)),NODRAW;
NN:=IF(REF(G,NNH)>REF(D,NNH)ANDNNH<=M-3,NNH,IF(REF(G,NNL)<REF(D,NNL)ANDNNL<=M-3,NNL,M-2)),NODRAW;
NNN:=IF(ISLASTBARANDNN>0,NN,M-2),NODRAW;
H1:=REF(H,NNN)=HHV(H,M-1);
L1:=REF(L,NNN)=LLV(L,M-1);
FG01:=BACKSET(H1,NNN+1)>BACKSET(H1,NNN),NODRAW;//只设置前面第M-1个
FD01:=BACKSET(L1,NNN+1)>BACKSET(L1,NNN),NODRAW;
FG02:=FG01=FD01ANDG>D,NODRAW;
FD02:=FG01=FD01ANDG<D,NODRAW;
TTTT:=BARSLAST(FD01),NODRAW;
FG0:=FG01ANDIF(FG02=1,H=HHV(H,BARSLAST(REF(FD01,1))+1),H=HHV(H,IF(BARSLAST(L=LLV(L,M))>=M-2,M-2,BARSLAST(FD01))))ANDFD02=0,NODRAW;
FD0:=FD01ANDIF(FD02=1,L=LLV(L,BARSLAST(REF(FG01,1))+1),L=LLV(L,IF(BARSLAST(H=HHV(L,M))>=M-2,M-2,BARSLAST(FG01)))) ANDFG02=0,NODRAW;
//高低点间周期
GT:=BARSLAST(FG0),NODRAW;
DT:=BARSLAST(FD0),NODRAW;
//第一次处理高低点间多余的点
LLLL:=DT=0ANDREF(DT,1)<GTANDL>REF(L,REF(DT,1)+1),NODRAW;
FG1:=BACKSET(REFX(GT,1)=0ANDGT<DTANDREFX(H,1)>=REF(H,GT),GT+1),NODRAW;
FD1:=BACKSET(REFX(DT,1)=0ANDDT<GTANDREFX(L,1)<=REF(L,DT),DT+1),NODRAW;
FG11:=IF(GT=0ANDREF(GT,1)<DTANDIF(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(GT,1)+1),1,0),NODRAW;
FD11:=IF(DT=0ANDREF(DT,1)<GTANDIF(REF(G,BARSLAST(H=HHV(H,M)))<REF(D,BARSLAST(H=HHV(H,M))),BARSLAST(H=HHV(H,M))<M-2,1)ANDL>REF(L,REF(DT,1)+1),1,0),NODRAW;
//再次周期
GT1:=BARSLAST(FG11<>1ANDFG1<>1ANDFG0),NODRAW;
DT1:=BARSLAST(FD11<>1ANDFD1<>1ANDFD0),NODRAW;
FD2:=BACKSET(REFX(GT1,1)=0ANDDT1<3ANDGT1-DT1<4ANDREF(L,DT1)>LLV(L,GT1+M-2),DT1+1),NODRAW;
FG2A:=BACKSET(REFX(GT1,1)=0ANDDT1<3ANDGT1-DT1<4ANDREF(L,DT1)<=LLV(L,GT1+M-2)ANDREF(H,GT1)>HHV(H,GT1+M-2),GT1+1),NODRAW;
FG2B:=IF(GT1=0ANDDT1<4ANDREF(GT1,1)-DT1<4ANDREF(L,DT1)<=LLV(L,REF(GT1,1)+M-1)ANDH>HHV(H,REF(GT1,1)+M-1),1,0),NODRAW;
FG2:=BACKSET(REFX(DT1,1)=0ANDGT1<3ANDDT1-GT1<4ANDREF(H,GT1)<HHV(H,DT1+M-2),GT1+1),NODRAW;
FD2A:=BACKSET(REFX(DT1,1)=0ANDGT1<3ANDDT1-GT1<4ANDREF(H,GT1)>=HHV(L,DT1+M-2)ANDREF(L,DT1)>LLV(L,DT1+M-2),DT1+1),NODRAW;
FD2B:=IF(DT1=0ANDGT1<4ANDREF(DT1,1)-GT1<4ANDREF(H,GT1)>=HHV(H,REF(DT1,1)+6)ANDL>LLV(L,REF(DT1,1)+M-1),1,0),NODRAW;
TTTTTT:=H<REF(H,REF(GT1,1)+1)ANDDT1<4,NODRAW;
HHHHHH:=REF(LLV(L,10),DT1),NODRAW;
//前长后短;
FG21:=IF(GT1=0ANDDT1<4ANDH<=REF(H,REF(GT1,1)+1) ,1,0),NODRAW;
FD21:=IF(DT1=0ANDGT1<4 ANDL>=REF(L,REF(DT1,1)+1),1,0),NODRAW;
//前短后长,前低后高(去低);
FD231:=BACKSET(REFX(GT1,1)=0ANDDT1>3ANDGT1>DT1ANDGT1-DT1<4ANDREFX(H,1)>REF(H,GT1)ANDREF(L,DT1)>REF(LLV(L,10),DT1),DT1+1),NODRAW;
FG23:=BACKSET(REFX(GT1,1)=0ANDDT1>3ANDGT1>DT1AND GT1-DT1<4ANDREFX(H,1)>REF(H,GT1)AND(REF(H,GT1)<REF(HHV(H,13),GT1)ORREF(FD231,DT1)=0),GT1+1),NODRAW;
//前短后长,去2;
FG231:=BACKSET(REFX(DT1,1)=0ANDGT1>3 ANDDT1>GT1ANDDT1-GT1<4ANDREFX(L,1)<REF(L,DT1)ANDREF(H,GT1)<REF(HHV(H,10),GT1),GT1+1),NODRAW;
FD23:=BACKSET(REFX(DT1,1)=0ANDGT1>3 ANDDT1>GT1ANDDT1-GT1<4ANDREFX(L,1)<REF(L,DT1)AND(REF(L,DT1)>REF(LLV(L,13),DT1)ORREF(FG231,GT1)=0),DT1+1),NODRAW;
//前短后长,去3;
FDD23:=REF(H,GT1)<REF(HHV(H,10),GT1)ORREF(FD23,DT1)=0,NODRAW;
FD24:=BACKSET(REFX(GT1,1)=0ANDDT1>3ANDGT1>DT1ANDGT1-DT1<4ANDREFX(H,1)<HHV(H,GT1+3)ANDREF(L,DT1)>LLV(L,DT1+5),DT1+1),NODRAW;
FG24:=BACKSET(REFX(DT1,1)=0ANDGT1>3 ANDDT1>GT1ANDDT1-GT1<4ANDREFX(L,1)>LLV(L,DT1+3)ANDREF(H,GT1)<HHV(H,GT1+5),GT1+1),NODRAW;
//做两次高低点间多余的点
GT2:=BARSLAST(FG21<>1ANDFG23<>1ANDFG231<>1ANDFG24<>1 ANDFG2<>1ANDFG2A<>1ANDFG2B<>1ANDGT1=0),NODRAW;
DT2:=BARSLAST(FD21<>1ANDFD23<>1ANDFD231<>1ANDFD24<>1 ANDFD2<>1ANDFD2A<>1ANDFD2B<>1ANDDT1=0),NODRAW;
FG3:=BACKSET(REFX(GT2,1)=0ANDGT2<DT2ANDREFX(H,1)>=REF(H,GT2),GT2+1),NODRAW;
FD3:=BACKSET(REFX(DT2,1)=0ANDDT2<GT2ANDREFX(L,1)<=REF(L,DT2),DT2+1),NODRAW;
FG31:=IF(GT2=0ANDREF(GT2,1)<DT2ANDH<REF(H,REF(GT2,1)+1),1,0),NODRAW;
FD31:=IF(DT2=0ANDREF(DT2,1)<GT2ANDL>REF(L,REF(DT2,1)+1),1,0),NODRAW;
GT3:=BARSLAST(GT2=0ANDFG3<>1ANDFG31<>1),NODRAW;
DT3:=BARSLAST(DT2=0AND FD3<>1ANDFD31<>1),NODRAW;
FG4:=BACKSET(REFX(GT3,1)=0ANDGT3<DT3ANDREFX(H,1)>=REF(H,GT3),GT3+1),NODRAW;
FD4:=BACKSET(REFX(DT3,1)=0ANDDT3<GT3ANDREFX(L,1)<=REF(L,DT3),DT3+1),NODRAW;
FG41:=IF(GT3=0ANDREF(GT3,1)<DT3ANDH<REF(H,REF(GT3,1)+1),1,0),NODRAW;
FD41:=IF(DT3=0ANDREF(DT3,1)<GT3ANDL>REF(L,REF(DT3,1)+1),1,0),NODRAW;
HHH:=GT3=0ANDFG31<>1AND FG3<>1,NODRAW;
LLL:=DT3=0ANDFD31<>1AND FD3<>1,NODRAW;
DRAWNUMBER(REFX(HHH,1),REFX(H,1),BARSLAST(LLL)+1,0),COLORCYAN,ALIGN2,VALIGN2,FONTSIZE22;
DRAWNUMBER(REFX(LLL,1),REFX(L,1),BARSLAST(HHH)+1,0),COLORWHITE,ALIGN2,VALIGN0,FONTSIZE22; 来源 程序化久久网
老师好,麻烦老师将最后两行的数字能够表达出来,谢谢。
M:=5;//M值需要大于等于5G:=MA(C,5);
D:=MA(C,10);
NNH:=BARSLAST(H=HHV(H,M)) ,NODRAW;
NNL:=BARSLAST(L=LLV(L,M)) ,NODRAW;
NN:=IF(REF(G,NNH)>REF(D,NNH) AND NNH<=M-3,NNH,IF(REF(G,NNL)<REF(D,NNL) AND NNL<=M-3,NNL,M-2)) ,NODRAW;
NNN:=IF(ISLASTBAR AND NN>0,NN,M-2) ,NODRAW;
H1:=REF(H,NNN)=HHV(H,M-1);
L1:=REF(L,NNN)=LLV(L,M-1);
FG01:=BACKSET(H1,NNN+1)>BACKSET(H1,NNN),NODRAW;//只设置前面第M-1个
FD01:=BACKSET(L1,NNN+1)>BACKSET(L1,NNN) ,NODRAW;
FG02:=FG01=FD01 AND G>D,NODRAW;
FD02:=FG01=FD01 AND G<D,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,M))>=M-2,M-2,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,M))>=M-2,M-2,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,M)))>REF(D,BARSLAST(L=LLV(L,M))),BARSLAST(L=LLV(L,M))<M-2,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,M)))<REF(D,BARSLAST(H=HHV(H,M))),BARSLAST(H=HHV(H,M))<M-2,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+M-2),DT1+1),NODRAW;
FG2A:=BACKSET(REFX(GT1,1)=0 AND DT1<3 AND GT1-DT1<4 AND REF(L,DT1)<=LLV(L,GT1+M-2) AND REF(H,GT1)>HHV(H,GT1+M-2),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)+M-1) AND H>HHV(H,REF(GT1,1)+M-1),1,0),NODRAW;
FG2:=BACKSET(REFX(DT1,1)=0 AND GT1<3 AND DT1-GT1<4 AND REF(H,GT1)<HHV(H,DT1+M-2),GT1+1),NODRAW;
FD2A:=BACKSET(REFX(DT1,1)=0 AND GT1<3 AND DT1-GT1<4 AND REF(H,GT1)>=HHV(L,DT1+M-2) AND REF(L,DT1)>LLV(L,DT1+M-2),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)+M-1),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;
//前短后长,去2;
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;
//前短后长,去3;
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 FD2A<>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,NODRAW;
LLL:=DT3=0 AND FD31<>1 AND FD3<>1,NODRAW;
DRAWNUMBER(REFX(HHH,1),REFX(H,1),BARSLAST(LLL)+1,0,COLORCYAN),ALIGN2,VALIGN2,FONTSIZE22;
DRAWNUMBER(REFX(LLL,1),REFX(L,1),BARSLAST(HHH)+1,0,COLORWHITE),ALIGN2,VALIGN0,FONTSIZE22;
来源:程序化99网( WWW.CXH99.COM )
博易技术人员: 一并下面两个也改一下,谢谢。DRAWCOLORKLINE( HHH ,COLORWHITE,0);DRAWCOLORKLINE(LLL,COLORYELLOW,0); M:=5;//M值需要大于等于5
G:=MA(C,5);
D:=MA(C,10);
NNH:=BARSLAST(H=HHV(H,M)),NODRAW;
NNL:=BARSLAST(L=LLV(L,M)),NODRAW;
NN:=IF(REF(G,NNH)>REF(D,NNH)ANDNNH<=M-3,NNH,IF(REF(G,NNL)<REF(D,NNL)ANDNNL<=M-3,NNL,M-2)),NODRAW;
NNN:=IF(ISLASTBARANDNN>0,NN,M-2),NODRAW;
H1:=REF(H,NNN)=HHV(H,M-1);
L1:=REF(L,NNN)=LLV(L,M-1);
FG01:=BACKSET(H1,NNN+1)>BACKSET(H1,NNN),NODRAW;//只设置前面第M-1个
FD01:=BACKSET(L1,NNN+1)>BACKSET(L1,NNN),NODRAW;
FG02:=FG01=FD01ANDG>D,NODRAW;
FD02:=FG01=FD01ANDG<D,NODRAW;
TTTT:=BARSLAST(FD01),NODRAW;
FG0:=FG01ANDIF(FG02=1,H=HHV(H,BARSLAST(REF(FD01,1))+1),H=HHV(H,IF(BARSLAST(L=LLV(L,M))>=M-2,M-2,BARSLAST(FD01))))ANDFD02=0,NODRAW;
FD0:=FD01ANDIF(FD02=1,L=LLV(L,BARSLAST(REF(FG01,1))+1),L=LLV(L,IF(BARSLAST(H=HHV(L,M))>=M-2,M-2,BARSLAST(FG01)))) ANDFG02=0,NODRAW;
//高低点间周期
GT:=BARSLAST(FG0),NODRAW;
DT:=BARSLAST(FD0),NODRAW;
//第一次处理高低点间多余的点
LLLL:=DT=0ANDREF(DT,1)<GTANDL>REF(L,REF(DT,1)+1),NODRAW;
FG1:=BACKSET(REFX(GT,1)=0ANDGT<DTANDREFX(H,1)>=REF(H,GT),GT+1),NODRAW;
FD1:=BACKSET(REFX(DT,1)=0ANDDT<GTANDREFX(L,1)<=REF(L,DT),DT+1),NODRAW;
FG11:=IF(GT=0ANDREF(GT,1)<DTANDIF(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(GT,1)+1),1,0),NODRAW;
FD11:=IF(DT=0ANDREF(DT,1)<GTANDIF(REF(G,BARSLAST(H=HHV(H,M)))<REF(D,BARSLAST(H=HHV(H,M))),BARSLAST(H=HHV(H,M))<M-2,1)ANDL>REF(L,REF(DT,1)+1),1,0),NODRAW;
//再次周期
GT1:=BARSLAST(FG11<>1ANDFG1<>1ANDFG0),NODRAW;
DT1:=BARSLAST(FD11<>1ANDFD1<>1ANDFD0),NODRAW;
FD2:=BACKSET(REFX(GT1,1)=0ANDDT1<3ANDGT1-DT1<4ANDREF(L,DT1)>LLV(L,GT1+M-2),DT1+1),NODRAW;
FG2A:=BACKSET(REFX(GT1,1)=0ANDDT1<3ANDGT1-DT1<4ANDREF(L,DT1)<=LLV(L,GT1+M-2)ANDREF(H,GT1)>HHV(H,GT1+M-2),GT1+1),NODRAW;
FG2B:=IF(GT1=0ANDDT1<4ANDREF(GT1,1)-DT1<4ANDREF(L,DT1)<=LLV(L,REF(GT1,1)+M-1)ANDH>HHV(H,REF(GT1,1)+M-1),1,0),NODRAW;
FG2:=BACKSET(REFX(DT1,1)=0ANDGT1<3ANDDT1-GT1<4ANDREF(H,GT1)<HHV(H,DT1+M-2),GT1+1),NODRAW;
FD2A:=BACKSET(REFX(DT1,1)=0ANDGT1<3ANDDT1-GT1<4ANDREF(H,GT1)>=HHV(L,DT1+M-2)ANDREF(L,DT1)>LLV(L,DT1+M-2),DT1+1),NODRAW;
FD2B:=IF(DT1=0ANDGT1<4ANDREF(DT1,1)-GT1<4ANDREF(H,GT1)>=HHV(H,REF(DT1,1)+6)ANDL>LLV(L,REF(DT1,1)+M-1),1,0),NODRAW;
TTTTTT:=H<REF(H,REF(GT1,1)+1)ANDDT1<4,NODRAW;
HHHHHH:=REF(LLV(L,10),DT1),NODRAW;
//前长后短;
FG21:=IF(GT1=0ANDDT1<4ANDH<=REF(H,REF(GT1,1)+1) ,1,0),NODRAW;
FD21:=IF(DT1=0ANDGT1<4 ANDL>=REF(L,REF(DT1,1)+1),1,0),NODRAW;
//前短后长,前低后高(去低);
FD231:=BACKSET(REFX(GT1,1)=0ANDDT1>3ANDGT1>DT1ANDGT1-DT1<4ANDREFX(H,1)>REF(H,GT1)ANDREF(L,DT1)>REF(LLV(L,10),DT1),DT1+1),NODRAW;
FG23:=BACKSET(REFX(GT1,1)=0ANDDT1>3ANDGT1>DT1AND GT1-DT1<4ANDREFX(H,1)>REF(H,GT1)AND(REF(H,GT1)<REF(HHV(H,13),GT1)ORREF(FD231,DT1)=0),GT1+1),NODRAW;
//前短后长,去2;
FG231:=BACKSET(REFX(DT1,1)=0ANDGT1>3 ANDDT1>GT1ANDDT1-GT1<4ANDREFX(L,1)<REF(L,DT1)ANDREF(H,GT1)<REF(HHV(H,10),GT1),GT1+1),NODRAW;
FD23:=BACKSET(REFX(DT1,1)=0ANDGT1>3 ANDDT1>GT1ANDDT1-GT1<4ANDREFX(L,1)<REF(L,DT1)AND(REF(L,DT1)>REF(LLV(L,13),DT1)ORREF(FG231,GT1)=0),DT1+1),NODRAW;
//前短后长,去3;
FDD23:=REF(H,GT1)<REF(HHV(H,10),GT1)ORREF(FD23,DT1)=0,NODRAW;
FD24:=BACKSET(REFX(GT1,1)=0ANDDT1>3ANDGT1>DT1ANDGT1-DT1<4ANDREFX(H,1)<HHV(H,GT1+3)ANDREF(L,DT1)>LLV(L,DT1+5),DT1+1),NODRAW;
FG24:=BACKSET(REFX(DT1,1)=0ANDGT1>3 ANDDT1>GT1ANDDT1-GT1<4ANDREFX(L,1)>LLV(L,DT1+3)ANDREF(H,GT1)<HHV(H,GT1+5),GT1+1),NODRAW;
//做两次高低点间多余的点
GT2:=BARSLAST(FG21<>1ANDFG23<>1ANDFG231<>1ANDFG24<>1 ANDFG2<>1ANDFG2A<>1ANDFG2B<>1ANDGT1=0),NODRAW;
DT2:=BARSLAST(FD21<>1ANDFD23<>1ANDFD231<>1ANDFD24<>1 ANDFD2<>1ANDFD2A<>1ANDFD2B<>1ANDDT1=0),NODRAW;
FG3:=BACKSET(REFX(GT2,1)=0ANDGT2<DT2ANDREFX(H,1)>=REF(H,GT2),GT2+1),NODRAW;
FD3:=BACKSET(REFX(DT2,1)=0ANDDT2<GT2ANDREFX(L,1)<=REF(L,DT2),DT2+1),NODRAW;
FG31:=IF(GT2=0ANDREF(GT2,1)<DT2ANDH<REF(H,REF(GT2,1)+1),1,0),NODRAW;
FD31:=IF(DT2=0ANDREF(DT2,1)<GT2ANDL>REF(L,REF(DT2,1)+1),1,0),NODRAW;
GT3:=BARSLAST(GT2=0ANDFG3<>1ANDFG31<>1),NODRAW;
DT3:=BARSLAST(DT2=0AND FD3<>1ANDFD31<>1),NODRAW;
FG4:=BACKSET(REFX(GT3,1)=0ANDGT3<DT3ANDREFX(H,1)>=REF(H,GT3),GT3+1),NODRAW;
FD4:=BACKSET(REFX(DT3,1)=0ANDDT3<GT3ANDREFX(L,1)<=REF(L,DT3),DT3+1),NODRAW;
FG41:=IF(GT3=0ANDREF(GT3,1)<DT3ANDH<REF(H,REF(GT3,1)+1),1,0),NODRAW;
FD41:=IF(DT3=0ANDREF(DT3,1)<GT3ANDL>REF(L,REF(DT3,1)+1),1,0),NODRAW;
HHH:=GT3=0ANDFG31<>1AND FG3<>1,NODRAW;
LLL:=DT3=0ANDFD31<>1AND FD3<>1,NODRAW;
DRAWNUMBER(REFX(HHH,1),REFX(H,1),BARSLAST(LLL)+1,0),COLORCYAN,ALIGN2,VALIGN2,FONTSIZE22;
DRAWNUMBER(REFX(LLL,1),REFX(L,1),BARSLAST(HHH)+1,0),COLORWHITE,ALIGN2,VALIGN0,FONTSIZE22; 来源 程序化久久网
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信号:cxh99cxh99 进行 有偿收费 编写!
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容