添加交易指令 [文华财经]
-
咨询内容:
帮我在里面加自动开仓,平仓,反手。
如果在1885.5K线后一K 线开仓多,到2005.0出现空信号,在2005.0后一K线进空,但是如果后一K线高于2005.0到2005.5(既每个品种最小变化单位),则不平仓,不开空,就这样反复的开,平,反手。不知道能不能实现。另外我想在K线图里面把均线显示出来。谢谢!!!
MA5:=MA(C,5);
MA10:=MA(C,10);
MA50:=MA(C,50)
CROSSDOWN(MA5,MA10),ICON(1,'ICO5');//MA5下穿MA10标注绿箭头
CROSSUP(MA5,MA10),ICON(0,'ICO4'),VALIGN0;//MA5上穿MA10,标注红箭头。G:=MA(C,5);
D:=MA(C,10);
NNH:=BARSLAST(H=HHV(H,7)) ,NODRAW;
NNL:=BARSLAST(L=LLV(L,7)) ,NODRAW;
//PD:=REF(G,NNH)>REF(D,NNH) ,NODRAW;
NN:=IF(REF(G,NNH)>REF(D,NNH) AND NNH<=4,NNH,IF(REF(G,NNL)<REF(D,NNL) AND NNL<=4,NNL,5)) ,NODRAW;
N:=IF(ISLASTBAR AND NN>0,NN,5) ,NODRAW;
HH:=REF(H,N)=HHV(H,6);
LL:=REF(L,N)=LLV(L,6);
FG01:BACKSET(HH,N+1)>BACKSET(HH,N),NODRAW;//只设置前面第6个
FD01:BACKSET(LL,N+1)>BACKSET(LL,N) ,NODRAW;
FG02:=FG01=FD01 AND G>D,NODRAW;
FD02:FG01=FD01 AND G<D,NODRAW;
//FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01,//高底是同一K看均线位置
// IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0)),NODRAW;//高点处BARLAST(FG01)=0
//FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01,
//IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0)),NODRAW;
TTTT:BARSLAST(FD01),NODRAW;
//FG0:=FG01 AND H=HHV(H,IF(FG02=1,BARSLAST(REF(FD01,1))+1,BARSLAST(FD01))) AND FD02=0 ,NODRAW;
//FD0:=FD01 AND L=LLV(L,IF(FD02=1,BARSLAST(REF(FG01,1))+1,BARSLAST(FG01))) AND FG02=0 ,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(D,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(D,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;
//GGT1:=REF(GT1,1),NODRAW;
//处理两边都少于3根的笔
//HHHH:REF(H,GT1),NODRAW;
//HHHHH:HHV(H,GT1+5),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;
//加两句,低是最低,去两边;
//NL:GT1=0 AND DT1<4 AND REF(GT1,1)-DT1<4 ,NODRAW;
//LLLLLLLL:LLV(L,GT1+5),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;
FD2A: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;
//
//HHV(H,GT1+1)<HHV(H,GT1+15)
//GGG:HHV(H,GT1+1),NODRAW;
//DDD:HHV(H,GT1+15),NODRAW;
//处理单边都少于3根的笔
//GT11:=BARSLAST(GT1=0 AND FG2<>1),NODRAW;
//DT11:=BARSLAST(DT1=0 AND FD2<>1 AND FD20<>1),NODRAW;
//FG21:IF(GT1=0 AND DT1<4 AND H<HHV(H,REF(GT1,1)+3),1,0),NODRAW;
//FD21:IF(DT1=0 AND GT1<4 AND L>LLV(L,REF(DT1,1)+3) ,1,0),NODRAW;
//FD22:BACKSET(REFX(GT1,1)=0 AND DT1<3 AND REFX(H,1)>REF(H,GT1) AND REF(L,DT1)>LLV(L,GT1+5),DT1+1),NODRAW;
//FG22:BACKSET(REFX(DT1,1)=0 AND GT1<3 AND REFX(L,1)<REF(L,DT1) AND REF(H,GT1)<HHV(H,DT1+5),GT1+1),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;
//前短后长,前高后低(去高);
//NNN:REF(H,GT1)>=REF(HHV(H,8),GT1),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;
//FG241:IF(GT1=0 AND DT1>4 AND REF(GT1,1)-DT1<3 AND H<HHV(H,REF(GT1,1)+3) AND REF(FD24,DT1+2)<>1,1,0),NODRAW;
//FD241:IF(DT1=0 AND GT1>4 AND REF(DT1,1)-GT1<3 AND L>LLV(L,REF(DT1,1)+3) AND REF(FG24,GT1+2)<>1,1,0),NODRAW;
//FGE:BACKSET(ISLASTBAR AND DT1-GT1<3 AND DT1>GT1, GT1+1),NODRAW;
//FDE:BACKSET(ISLASTBAR AND GT1-DT1<3 AND GT1>DT1, DT1+1),NODRAW;
//FG21:IF(GT1=0 AND DT1<4 AND REF(GT1,1)<4,1,0),NODRAW;
//FD21:IF(DT1=0 AND GT1<4 AND REF(DT1,1)<4 ,1,0),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;
//HHX:REF(H,GT2),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;
//FD31:IF(DT2=0 AND REF(DT2,1)<REF(GT2,1) AND L>REF(L,DT2+1),1,0),NODRAW;
//HHH:=GT3=0,NODRAW;
//LLL:=DT3=0,NODRAW;
HHH:=GT3=0 AND FG31<>1 AND FG3<>1,NODRAW;
LLL:=DT3=0 AND FD31<>1 AND FD3<>1,NODRAW;
//HHH:=FG0 AND FG11<>1 AND FG1<>1 AND FG2<>1 AND FG21<>1 AND FG31<>1 AND FG3<>1;
//LLL:=FD0 AND FD11<>1 AND FD1<>1 AND FD2<>1 AND FD21<>1 AND FD31<>1 AND FD3<>1;
DRAWLINE1(HHH ,H,LLL,L,0),COLORWHITE,DOT;
DRAWLINE1(LLL,L,HHH ,H,0),COLORWHITE,DOT;
//DRAWLINE(,H,UU, L,COLORGREEN);
//PARTLINE(FG0 AND FG41<>1 AND FG4<>1 AND FG31<>1 AND FG3<>1 AND FG2<>1 AND FG11<>1 AND FG1<>1,H,COLORYELLOW),CIRCLEDOT,LINETHICK5;
//PARTLINE(FD0 AND FD41<>1 AND FD4<>1 AND FD31<>1 AND FD3<>1 AND FD2<>1 AND FD11<>1 AND FD1<>1,L,COLORCYAN),CIRCLEDOT,LINETHICK5;
//PARTLINE(FD01 ,L,COLORRED),CIRCLEDOT,LINETHICK2;
PARTLINE(FG0 ,H,COLORYELLOW),POINTDOT,LINETHICK2;
PARTLINE(FD0 ,L,COLORCYAN),CIRCLEDOT,LINETHICK2;
DRAWHORIZONTALLINE(FG0,H,COLORGREEN);
DRAWHORIZONTALLINE(FD0,L,COLORRED);
文件名:1544167635(1).png
来源:程序化99
-
文华技术人员:
怎么上不了图
来源: WWW.CXH99.COM
-
文华客服:
模型当中含有大量的未来函数,未来的K线并没有走出来,是不支持与交易指令一起使用的
正常的指令下单都是对当根K进行判断的,建议您调整下思路
显示均线参考:
MA5:MA(C,5); MA10:MA(C,10); MA50:MA(C,50) CROSSDOWN(MA5,MA10),ICON(1,'CO5';//MA5下穿MA10标注绿箭头 CROSSUP(MA5,MA10),ICON(0,'CO4',VALIGN0;//MA5上穿MA10,标注红箭头。
G:=MA(C,5); D:=MA(C,10);
NNH:=BARSLAST(H=HHV(H,7)) ,NODRAW;
NNL:=BARSLAST(L=LLV(L,7)) ,NODRAW; //PD:=REF(G,NNH)>REF(D,NNH) ,NODRAW; NN:=IF(REF(G,NNH)>REF(D,NNH) AND NNH<=4,NNH,IF(REF(G,NNL)<REF(D,NNL) AND NNL<=4,NNL,5)) ,NODRAW; N:=IF(ISLASTBAR AND NN>0,NN,5) ,NODRAW; HH:=REF(H,N)=HHV(H,6); LL:=REF(L,N)=LLV(L,6); FG01:BACKSET(HH,N+1)>BACKSET(HH,N),NODRAW;//只设置前面第6个 FD01:BACKSET(LL,N+1)>BACKSET(LL,N) ,NODRAW; FG02:=FG01=FD01 AND G>D,NODRAW; FD02:FG01=FD01 AND G<D,NODRAW; //FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01,//高底是同一K看均线位置 // IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0)),NODRAW;//高点处BARLAST(FG01)=0 //FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01, //IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0)),NODRAW; TTTT:BARSLAST(FD01),NODRAW; //FG0:=FG01 AND H=HHV(H,IF(FG02=1,BARSLAST(REF(FD01,1))+1,BARSLAST(FD01))) AND FD02=0 ,NODRAW; //FD0:=FD01 AND L=LLV(L,IF(FD02=1,BARSLAST(REF(FG01,1))+1,BARSLAST(FG01))) AND FG02=0 ,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(D,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(D,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; //GGT1:=REF(GT1,1),NODRAW; //处理两边都少于3根的笔 //HHHH:REF(H,GT1),NODRAW; //HHHHH:HHV(H,GT1+5),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; //加两句,低是最低,去两边; //NL:GT1=0 AND DT1<4 AND REF(GT1,1)-DT1<4 ,NODRAW; //LLLLLLLL:LLV(L,GT1+5),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;
FD2A: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; //
//HHV(H,GT1+1)<HHV(H,GT1+15) //GGG:HHV(H,GT1+1),NODRAW; //DDD:HHV(H,GT1+15),NODRAW; //处理单边都少于3根的笔 //GT11:=BARSLAST(GT1=0 AND FG2<>1),NODRAW; //DT11:=BARSLAST(DT1=0 AND FD2<>1 AND FD20<>1),NODRAW; //FG21:IF(GT1=0 AND DT1<4 AND H<HHV(H,REF(GT1,1)+3),1,0),NODRAW; //FD21:IF(DT1=0 AND GT1<4 AND L>LLV(L,REF(DT1,1)+3) ,1,0),NODRAW;
//FD22:BACKSET(REFX(GT1,1)=0 AND DT1<3 AND REFX(H,1)>REF(H,GT1) AND REF(L,DT1)>LLV(L,GT1+5),DT1+1),NODRAW; //FG22:BACKSET(REFX(DT1,1)=0 AND GT1<3 AND REFX(L,1)<REF(L,DT1) AND REF(H,GT1)<HHV(H,DT1+5),GT1+1),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;
//前短后长,前高后低(去高);
//NNN:REF(H,GT1)>=REF(HHV(H,8),GT1),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; //FG241:IF(GT1=0 AND DT1>4 AND REF(GT1,1)-DT1<3 AND H<HHV(H,REF(GT1,1)+3) AND REF(FD24,DT1+2)<>1,1,0),NODRAW; //FD241:IF(DT1=0 AND GT1>4 AND REF(DT1,1)-GT1<3 AND L>LLV(L,REF(DT1,1)+3) AND REF(FG24,GT1+2)<>1,1,0),NODRAW; //FGE:BACKSET(ISLASTBAR AND DT1-GT1<3 AND DT1>GT1, GT1+1),NODRAW; //FDE:BACKSET(ISLASTBAR AND GT1-DT1<3 AND GT1>DT1, DT1+1),NODRAW; //FG21:IF(GT1=0 AND DT1<4 AND REF(GT1,1)<4,1,0),NODRAW; //FD21:IF(DT1=0 AND GT1<4 AND REF(DT1,1)<4 ,1,0),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; //HHX:REF(H,GT2),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;
//FD31:IF(DT2=0 AND REF(DT2,1)<REF(GT2,1) AND L>REF(L,DT2+1),1,0),NODRAW; //HHH:=GT3=0,NODRAW; //LLL:=DT3=0,NODRAW; HHH:=GT3=0 AND FG31<>1 AND FG3<>1,NODRAW; LLL:=DT3=0 AND FD31<>1 AND FD3<>1,NODRAW; //HHH:=FG0 AND FG11<>1 AND FG1<>1 AND FG2<>1 AND FG21<>1 AND FG31<>1 AND FG3<>1; //LLL:=FD0 AND FD11<>1 AND FD1<>1 AND FD2<>1 AND FD21<>1 AND FD31<>1 AND FD3<>1; DRAWLINE1(HHH ,H,LLL,L,0),COLORWHITE,DOT; DRAWLINE1(LLL,L,HHH ,H,0),COLORWHITE,DOT;
//DRAWLINE(,H,UU, L,COLORGREEN); //PARTLINE(FG0 AND FG41<>1 AND FG4<>1 AND FG31<>1 AND FG3<>1 AND FG2<>1 AND FG11<>1 AND FG1<>1,H,COLORYELLOW),CIRCLEDOT,LINETHICK5; //PARTLINE(FD0 AND FD41<>1 AND FD4<>1 AND FD31<>1 AND FD3<>1 AND FD2<>1 AND FD11<>1 AND FD1<>1,L,COLORCYAN),CIRCLEDOT,LINETHICK5; //PARTLINE(FD01 ,L,COLORRED),CIRCLEDOT,LINETHICK2; PARTLINE(FG0 ,H,COLORYELLOW),POINTDOT,LINETHICK2; PARTLINE(FD0 ,L,COLORCYAN),CIRCLEDOT,LINETHICK2; DRAWHORIZONTALLINE(FG0,H,COLORGREEN); DRAWHORIZONTALLINE(FD0,L,COLORRED); -
网友回复:
能加个信号提示吗?高低位置的。或者是能加止损开仓
-
网友回复:
高低位置信号提示参考:
MA5:MA(C,5); MA10:MA(C,10); MA50:MA(C,50); CROSSDOWN(MA5,MA10),ICON(1,'CO5';//MA5下穿MA10标注绿箭头 CROSSUP(MA5,MA10),ICON(0,'CO4',VALIGN0;//MA5上穿MA10,标注红箭头。
G:=MA(C,5); D:=MA(C,10);
NNH:=BARSLAST(H=HHV(H,7)) ,NODRAW;
NNL:=BARSLAST(L=LLV(L,7)) ,NODRAW; //PD:=REF(G,NNH)>REF(D,NNH) ,NODRAW; NN:=IF(REF(G,NNH)>REF(D,NNH) AND NNH<=4,NNH,IF(REF(G,NNL)<REF(D,NNL) AND NNL<=4,NNL,5)) ,NODRAW; N:=IF(ISLASTBAR AND NN>0,NN,5) ,NODRAW; HH:=REF(H,N)=HHV(H,6); LL:=REF(L,N)=LLV(L,6); FG01:BACKSET(HH,N+1)>BACKSET(HH,N),NODRAW;//只设置前面第6个 FD01:BACKSET(LL,N+1)>BACKSET(LL,N) ,NODRAW; FG02:=FG01=FD01 AND G>D,NODRAW; FD02:FG01=FD01 AND G<D,NODRAW; //FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01,//高底是同一K看均线位置 // IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0)),NODRAW;//高点处BARLAST(FG01)=0 //FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01, //IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0)),NODRAW; TTTT:BARSLAST(FD01),NODRAW; //FG0:=FG01 AND H=HHV(H,IF(FG02=1,BARSLAST(REF(FD01,1))+1,BARSLAST(FD01))) AND FD02=0 ,NODRAW; //FD0:=FD01 AND L=LLV(L,IF(FD02=1,BARSLAST(REF(FG01,1))+1,BARSLAST(FG01))) AND FG02=0 ,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(D,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(D,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; //GGT1:=REF(GT1,1),NODRAW; //处理两边都少于3根的笔 //HHHH:REF(H,GT1),NODRAW; //HHHHH:HHV(H,GT1+5),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; //加两句,低是最低,去两边; //NL:GT1=0 AND DT1<4 AND REF(GT1,1)-DT1<4 ,NODRAW; //LLLLLLLL:LLV(L,GT1+5),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;
FD2A: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; //
//HHV(H,GT1+1)<HHV(H,GT1+15) //GGG:HHV(H,GT1+1),NODRAW; //DDD:HHV(H,GT1+15),NODRAW; //处理单边都少于3根的笔 //GT11:=BARSLAST(GT1=0 AND FG2<>1),NODRAW; //DT11:=BARSLAST(DT1=0 AND FD2<>1 AND FD20<>1),NODRAW; //FG21:IF(GT1=0 AND DT1<4 AND H<HHV(H,REF(GT1,1)+3),1,0),NODRAW; //FD21:IF(DT1=0 AND GT1<4 AND L>LLV(L,REF(DT1,1)+3) ,1,0),NODRAW;
//FD22:BACKSET(REFX(GT1,1)=0 AND DT1<3 AND REFX(H,1)>REF(H,GT1) AND REF(L,DT1)>LLV(L,GT1+5),DT1+1),NODRAW; //FG22:BACKSET(REFX(DT1,1)=0 AND GT1<3 AND REFX(L,1)<REF(L,DT1) AND REF(H,GT1)<HHV(H,DT1+5),GT1+1),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;
//前短后长,前高后低(去高);
//NNN:REF(H,GT1)>=REF(HHV(H,8),GT1),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; //FG241:IF(GT1=0 AND DT1>4 AND REF(GT1,1)-DT1<3 AND H<HHV(H,REF(GT1,1)+3) AND REF(FD24,DT1+2)<>1,1,0),NODRAW; //FD241:IF(DT1=0 AND GT1>4 AND REF(DT1,1)-GT1<3 AND L>LLV(L,REF(DT1,1)+3) AND REF(FG24,GT1+2)<>1,1,0),NODRAW; //FGE:BACKSET(ISLASTBAR AND DT1-GT1<3 AND DT1>GT1, GT1+1),NODRAW; //FDE:BACKSET(ISLASTBAR AND GT1-DT1<3 AND GT1>DT1, DT1+1),NODRAW; //FG21:IF(GT1=0 AND DT1<4 AND REF(GT1,1)<4,1,0),NODRAW; //FD21:IF(DT1=0 AND GT1<4 AND REF(DT1,1)<4 ,1,0),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; //HHX:REF(H,GT2),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;
//FD31:IF(DT2=0 AND REF(DT2,1)<REF(GT2,1) AND L>REF(L,DT2+1),1,0),NODRAW; //HHH:=GT3=0,NODRAW; //LLL:=DT3=0,NODRAW; HHH:=GT3=0 AND FG31<>1 AND FG3<>1,NODRAW; LLL:=DT3=0 AND FD31<>1 AND FD3<>1,NODRAW; //HHH:=FG0 AND FG11<>1 AND FG1<>1 AND FG2<>1 AND FG21<>1 AND FG31<>1 AND FG3<>1; //LLL:=FD0 AND FD11<>1 AND FD1<>1 AND FD2<>1 AND FD21<>1 AND FD31<>1 AND FD3<>1; DRAWLINE1(HHH ,H,LLL,L,0),COLORWHITE,DOT; DRAWLINE1(LLL,L,HHH ,H,0),COLORWHITE,DOT;
//DRAWLINE(,H,UU, L,COLORGREEN); //PARTLINE(FG0 AND FG41<>1 AND FG4<>1 AND FG31<>1 AND FG3<>1 AND FG2<>1 AND FG11<>1 AND FG1<>1,H,COLORYELLOW),CIRCLEDOT,LINETHICK5; //PARTLINE(FD0 AND FD41<>1 AND FD4<>1 AND FD31<>1 AND FD3<>1 AND FD2<>1 AND FD11<>1 AND FD1<>1,L,COLORCYAN),CIRCLEDOT,LINETHICK5; //PARTLINE(FD01 ,L,COLORRED),CIRCLEDOT,LINETHICK2; PARTLINE(FG0 ,H,COLORYELLOW),POINTDOT,LINETHICK2; PARTLINE(FD0 ,L,COLORCYAN),CIRCLEDOT,LINETHICK2; DRAWHORIZONTALLINE(FG0,H,COLORGREEN); DRAWHORIZONTALLINE(FD0,L,COLORRED); DRAWTEXT(CROSS(FG0,0.5),H,''; DRAWTEXT(CROSS(FD0,0.5),L,'';
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
相关文章
-
没有相关内容