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

老师,下面是缠论中的,请改成博弈能用,谢谢。 [博易POBO]

咨询内容:

老师,下面是缠论中的,请改成博弈能用,谢谢。

//黄金线
DX:=HHH>0||LLL>0;
H1:=VALUEWHEN(HHH,H);
H2:=VALUEWHEN(HHH,REF(H1,1));
H3:=VALUEWHEN(HHH,REF(H2,1));
L1:=VALUEWHEN(LLL,L);
L2:=VALUEWHEN(LLL,REF(L1,1));
L3:=VALUEWHEN(LLL,REF(L2,1));
HH:=MAX1(H1,H2,H3);
LL:=MIN1(L1,L2,L3);
Q:=MAX(SUMBARS(HHH,3),SUMBARS(LLL,3));
DRAWSL(ISLASTBAR,HH,0,-Q,0,COLORRED),LINETHICK2;
DRAWSL(ISLASTBAR,LL,0,-Q,0,COLORGREEN),LINETHICK2;
AA:HH-LL,NODRAW;
DRAWSL(ISLASTBAR,LL+AA*0.191,0,-Q,0,COLORFF85FF),DOT;
DRAWSL(ISLASTBAR,LL+AA*0.382,0,-Q,0,COLORGRAY),DOT;
DRAWSL(ISLASTBAR,LL+AA*0.500,0,-Q,0,COLOR5568FF),DOT;
DRAWSL(ISLASTBAR,LL+AA*0.618,0,-Q,0,COLORGRAY),DOT;
DRAWSL(ISLASTBAR,LL+AA*0.809,0,-Q,0,COLORFF85FF),DOT;

DRAWNUMBER(ISLASTBAR,HH,HH,0,COLORRED),VALIGN2,ALIGN2;
DRAWNUMBER(ISLASTBAR,LL,LL,0,COLORGREEN),VALIGN0,ALIGN2;
DRAWNUMBER(ISLASTBAR,LL+AA*0.191,LL+AA*0.191,0,COLORFF85FF),VALIGN0,ALIGN0;
DRAWNUMBER(ISLASTBAR,LL+AA*0.382,LL+AA*0.382,0,COLORGRAY),VALIGN0,ALIGN0;
DRAWNUMBER(ISLASTBAR,LL+AA*0.500,LL+AA*0.500,0,COLOR5568FF),VALIGN0,ALIGN0;
DRAWNUMBER(ISLASTBAR,LL+AA*0.618,LL+AA*0.618,0,COLORGRAY),VALIGN0,ALIGN0;
DRAWNUMBER(ISLASTBAR,LL+AA*0.809,LL+AA*0.809,0,COLORFF85FF),VALIGN0,ALIGN0;

//--------支撑压力位
AA1:=CROSS(COUNT(HHH,BARSLAST(LLL)+1)=1,0.5),NODRAW;
BB1:=CROSS(COUNT(LLL,BARSLAST(HHH)+1)=1,0.5),NODRAW;
AA1T:=BARSLAST(AA1)+1,NODRAW;
BB1T:=BARSLAST(BB1)+1,NODRAW;
DRAWSL(AA1,REF(REF(H,AA1T-1),1),0,-REF(AA1T,1),0,COLORGRAY),DASH;//压力线
DRAWSL(BB1,REF(REF(L,BB1T-1),1),0,-REF(BB1T,1),0,COLORGRAY),DASH;//支撑线
DRAWTEXT(AA1,REF(REF(H,AA1T-1),1),'S'),FONTSIZE20,COLORGREEN,VALIGN2;
DRAWTEXT(BB1,REF(REF(L,BB1T-1),1),'B'),FONTSIZE20,COLORFF85FF,VALIGN0;
DRAWLINE(AA1,H,AA1,REF(REF(H,AA1T-1),1),COLORWHITE),DOT;
DRAWLINE(BB1,L,BB1,REF(REF(L,BB1T-1),1),COLORMAGENTA),DOT;

 

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

博易技术人员: 公式不全,无法修改 老师,添加上需要的部分了。谢谢。
 
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,NNN1)>BACKSET(H1,NNN),NODRAW;//只设置前面第M-1个
FD01:=BACKSET(L1,NNN1)>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),GT1),NODRAW;
FD1:=BACKSET(REFX(DT,1)=0ANDDT<GTANDREFX(L,1)<=REF(L,DT),DT1),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,GT1M-2),DT11),NODRAW;
FG2A:=BACKSET(REFX(GT1,1)=0ANDDT1<3ANDGT1-DT1<4ANDREF(L,DT1)<=LLV(L,GT1M-2)ANDREF(H,GT1)>HHV(H,GT1M-2),GT11),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,DT1M-2),GT11),NODRAW;
FD2A:=BACKSET(REFX(DT1,1)=0ANDGT1<3ANDDT1-GT1<4ANDREF(H,GT1)>=HHV(L,DT1M-2)ANDREF(L,DT1)>LLV(L,DT1M-2),DT11),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),DT11),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),GT11),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),GT11),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),DT11),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,GT13)ANDREF(L,DT1)>LLV(L,DT15),DT11),NODRAW;
FG24:=BACKSET(REFX(DT1,1)=0ANDGT1>3 ANDDT1>GT1ANDDT1-GT1<4ANDREFX(L,1)>LLV(L,DT13)ANDREF(H,GT1)<HHV(H,GT15),GT11),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),GT21),NODRAW;
FD3:=BACKSET(REFX(DT2,1)=0ANDDT2<GT2ANDREFX(L,1)<=REF(L,DT2),DT21),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),GT31),NODRAW;
FD4:=BACKSET(REFX(DT3,1)=0ANDDT3<GT3ANDREFX(L,1)<=REF(L,DT3),DT31),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;
  来源 程序化久久网

 

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

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

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

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


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

相关文章

    没有相关内容