您现在的位置:程序化交易>> 期货公式>> 文华财经>> 文华财经知识>>正文内容

求改进公式,改成能交易的程序化指标! [文华财经]

  • 咨询内容:  把有阻力卖和有支撑买等字体去掉,只在有有阻力卖和有支撑买的地方执行卖空和买多的指令,用绿和红的箭头表示就行,并把多余的字母S和B去掉 N:=20;M:=32;P1:=80;P2:=100;VAR1:=(C+H+O+L)/4;卖出:=MA(VAR1,N)*(1+P1/1000),COLORGREEN,LINETHICK2;买入:=MA(VAR1,M)*(1-P2/1000),COLORMAGENTA,LINETHICK2;幅度:100*(卖出-买入)/买入,NODRAW;MA1:=MA(VAR1,3);/*STICKLINE(卖出>LOW AND 卖出<HIGH,卖出,MAX(卖出,MAX(OPEN,CLOSE)),3,0),COLORGREEN;STICKLINE(卖出>MIN(C,O) AND 卖出<MAX(C,O),卖出,MAX(OPEN,CLOSE),3,0),COLORGREEN;STICKLINE(卖出>LOW AND 卖出<HIGH,卖出,HIGH,0,0),COLORGREEN;STICKLINE(卖出<LOW,OPEN,CLOSE,3,0),COLORGREEN;STICKLINE(卖出<LOW,HIGH,LOW,0,0),COLORGREEN;STICKLINE(买入>LOW AND 买入<HIGH,买入,MIN(MIN(OPEN,CLOSE),买入),3,0),COLORMAGENTA;STICKLINE(买入>MIN(C,O) AND 买入<MAX(C,O),买入,MIN(OPEN,CLOSE),3,0),COLORMAGENTA;STICKLINE(买入>LOW AND 买入<HIGH,买入,LOW,0,0),COLORMAGENTA;STICKLINE(买入>HIGH,OPEN,CLOSE,3,0),COLORMAGENTA;STICKLINE(买入>HIGH,HIGH,LOW,0,0),COLORMAGENTA;*/DRAWTEXT(CROSS(LOW,买入),LOW*0.95,'',COLORRED,LINETHICK2;DRAWTEXT(CROSS(卖出,HIGH),HIGH*1.02,'',COLORGREEN;
    VAR3:=LLV(HIGH,240);VAR4:=100*(CLOSE-VAR3);VAR5:=(CLOSE-LLV(LOW,528))/(HHV(HIGH,528)-LLV(LOW,528))*100;VAR6:=(CLOSE-LLV(CLOSE,530))/(HHV(CLOSE,530)-LLV(CLOSE,530))*100;VAR7:=0;VAR8:=SMA(MAX(CLOSE-REF(CLOSE,1),0),34,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),7,1)*100;VAR9:=SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100;VAR10:=IF(TROUGHBARS(C,16,1,1)=0 AND HIGH>LOW+0.04,4,0);VAR11:=ZIGZAG(C,6,1)>REF(ZIGZAG(C,6,1),1) AND REF(ZIGZAG(C,6,1),1)<=REF(ZIGZAG(C,6,1),2) AND REF(ZIGZAG(C,6,1),2)<=REF(ZIGZAG(C,6,1),3);VAR12:=ZIGZAG(C,6,1)<REF(ZIGZAG(C,6,1),1) AND REF(ZIGZAG(C,6,1),1)>=REF(ZIGZAG(C,6,1),2) AND REF(ZIGZAG(C,6,1),2)>=REF(ZIGZAG(C,6,1),3);VAR13:=ZIGZAG(C,22,1)>REF(ZIGZAG(C,22,1),1) AND REF(ZIGZAG(C,22,1),1)<=REF(ZIGZAG(C,22,1),2) AND REF(ZIGZAG(C,22,1),2)<=REF(ZIGZAG(C,22,1),3);VAR14:=ZIGZAG(C,22,1)<REF(ZIGZAG(C,22,1),1) AND REF(ZIGZAG(C,22,1),1)>=REF(ZIGZAG(C,22,1),2) AND REF(ZIGZAG(C,22,1),2)>=REF(ZIGZAG(C,22,1),3);VAR15:=ZIGZAG(C,51,1)>REF(ZIGZAG(C,51,1),1) AND REF(ZIGZAG(C,51,1),1)<=REF(ZIGZAG(C,51,1),2) AND REF(ZIGZAG(C,51,1),2)<=REF(ZIGZAG(C,51,1),3);VAR16:=ZIGZAG(C,51,1)<REF(ZIGZAG(C,51,1),1) AND REF(ZIGZAG(C,51,1),1)>=REF(ZIGZAG(C,51,1),2) AND REF(ZIGZAG(C,51,1),2)>=REF(ZIGZAG(C,51,1),3);VAR17:=ZIGZAG(C,72,1)>REF(ZIGZAG(C,72,1),1) AND REF(ZIGZAG(C,72,1),1)<=REF(ZIGZAG(C,72,1),2) AND REF(ZIGZAG(C,72,1),2)<=REF(ZIGZAG(C,72,1),3);VAR18:=ZIGZAG(C,72,1)<REF(ZIGZAG(C,72,1),1) AND REF(ZIGZAG(C,72,1),1)>=REF(ZIGZAG(C,72,1),2) AND REF(ZIGZAG(C,72,1),2)>=REF(ZIGZAG(C,72,1),3);VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);买1:=VAR10;买2:=(VAR11+VAR13+VAR15+VAR17);卖1:=(VAR12+VAR14+VAR16+VAR18);
    S:=IF(卖1>0,HIGH*1.01,NULL),CROSSDOT,LINETHICK3,COLORGREEN;DRAWTEXT(卖1>0,HIGH*1.02,'进',COLORGREEN;DRAWICON((ZIGZAG(C,5,1)>REF(ZIGZAG(C,5,1),1)) AND (REF(ZIGZAG(C,5,1),1)<=REF(ZIGZAG(C,5,1),2)) AND (REF(ZIGZAG(C,5,1),2)<=REF(ZIGZAG(C,5,1),3)),LOW*0.98,1) ;DRAWICON((ZIGZAG(C,5,1)<REF(ZIGZAG(C,5,1),1)) AND (REF(ZIGZAG(C,5,1),1)>=REF(ZIGZAG(C,5,1),2)) AND (REF(ZIGZAG(C,5,1),2)>=REF(ZIGZAG(C,5,1),3)),HIGH*1.01,2);ZB:=EMA(EMA(VAR3,5),5)*3, COLORSTICK;VARA:=IF(VAR9 AND CROSS(MA(CLOSE,3),MA(CLOSE,5)),20,0);K:=EMA(VAR7,5)*2,  COLORFF00FF;D:=EMA(K,5),  COLORWHITE;J:=K*3-D*2,COLORYELLOW;VARB:=BETWEEN(CLOSE,MA(CLOSE,3),MA(CLOSE,5)) AND J>10;

    DRAWTEXT(VAR11 AND COUNT(VAR11,30)=1,LOW*0.95,'金进场',LINETHICK1,COLORFF00FF;VAR1B:=IF(VAR14>=200 AND VAR13>=150,15,IF(VAR14<=-200 AND VAR13<=-150,-15,VAR16))+60;量能突破:=SUM(IF(C=REF(C,1),0,IF(C>REF(C,1),VOL,-VOL)),0);


    P:=7;小波段:=ZIGZAG(C,P,1),COLORWHITE,LINETHICK1;小波段底:=ZIGZAG(C,P,1)>REF(ZIGZAG(C,P,1),1) AND REF(ZIGZAG(C,P,1),1)<=REF(ZIGZAG(C,P,1),2) AND REF(ZIGZAG(C,P,1),2)<=REF(ZIGZAG(C,P,1),3);小波段顶:=ZIGZAG(C,P,1)<REF(ZIGZAG(C,P,1),1) AND REF(ZIGZAG(C,P,1),1)>=REF(ZIGZAG(C,P,1),2) AND REF(ZIGZAG(C,P,1),2)>=REF(ZIGZAG(C,P,1),3);
    DRAWTEXT(小波段底,L-0.02,'',COLORYELLOW;DRAWTEXT(小波段顶,H+0.15,'',COLORMAGENTA;趋势:=ZIGZAG(C,N,1);大波段底:=IF(趋势>REF(趋势,1),趋势,NULL),COLORRED,LINETHICK2;大波段顶:=IF(趋势<REF(趋势,1),趋势,NULL),COLORBLUE,LINETHICK2;

    BUY1:=ZIGZAG(C,10,1);SELL1:=MA(BUY1,2);DRAWICON(CROSS(BUY1,SELL1),L-0.3,7);DRAWICON(CROSS(SELL1,BUY1),H+0.2,8);/*STICKLINE(BUY1>SELL1 AND O>=C,C,O,-1,0),COLORRED;STICKLINE(BUY1>SELL1 AND O>=C,L,H,0,0),COLORRED;STICKLINE(BUY1<SELL1 AND O<=C,O,C,-1,1),COLORCYAN;STICKLINE(BUY1<SELL1 AND O<=C,O,L,0,1),COLORCYAN;STICKLINE(BUY1<SELL1 AND O<=C,C,H,0,1),COLORCYAN;*/

    PL5:=ZIGZAG(C,5,1);EN1:=ZIGZAG(C,5,1)>REF(ZIGZAG(C,5,1),1) AND REF(ZIGZAG(C,5,1),1)<=REF(ZIGZAG(C,5,1),2) AND REF(ZIGZAG(C,5,1),2)<=REF(ZIGZAG(C,5,1),3);EX1:=ZIGZAG(C,5,1)<REF(ZIGZAG(C,5,1),1) AND REF(ZIGZAG(C,5,1),1)>=REF(ZIGZAG(C,5,1),2) AND REF(ZIGZAG(C,5,1),2)>=REF(ZIGZAG(C,5,1),3);PL10:=ZIGZAG(C,10,1);
    EN2:=ZIGZAG(C,10,1)>REF(ZIGZAG(C,10,1),1) AND REF(ZIGZAG(C,10,1),1)<=REF(ZIGZAG(C,10,1),2) AND REF(ZIGZAG(C,10,1),2)<=REF(ZIGZAG(C,10,1),3);EX2:=ZIGZAG(C,10,1)<REF(ZIGZAG(C,10,1),1) AND REF(ZIGZAG(C,10,1),1)>=REF(ZIGZAG(C,10,1),2) AND REF(ZIGZAG(C,10,1),2)>=REF(ZIGZAG(C,10,1),3);PL20:=ZIGZAG(C,20,1);EN3:=ZIGZAG(C,20,1)>REF(ZIGZAG(C,20,1),1) AND REF(ZIGZAG(C,20,1),1)<=REF(ZIGZAG(C,20,1),2) AND REF(ZIGZAG(C,20,1),2)<=REF(ZIGZAG(C,20,1),3);EX3:=ZIGZAG(C,20,1)<REF(ZIGZAG(C,20,1),1) AND REF(ZIGZAG(C,20,1),1)>=REF(ZIGZAG(C,20,1),2) AND REF(ZIGZAG(C,20,1),2)>=REF(ZIGZAG(C,20,1),3);PL40:=ZIGZAG(C,40,1);走强1:=BARSLAST(PL5<REF(PL5,1));走弱1:=BARSLAST(PL5>REF(PL5,1));走强2:=BARSLAST(PL10<REF(PL10,1));走弱2:=BARSLAST(PL10>REF(PL10,1));走强3:=BARSLAST(PL20<REF(PL20,1));走弱3:=BARSLAST(PL20>REF(PL20,1));ZTJZ5:=IF(PL10>REF(PL10,1),COUNT(EN1,走强2),0);ZTJD5:=IF(PL10>REF(PL10,1),COUNT(EX1,走强2),0);DTJZ5:=IF(PL10<REF(PL10,1),COUNT(EN1,走弱2),0);DTJD5:=IF(PL10<REF(PL10,1),COUNT(EX1,走弱2),0);ZTJZ10:=IF(PL20>REF(PL20,1),COUNT(EN2,走强3),0);ZTJD10:=IF(PL20>REF(PL20,1),COUNT(EX2,走强3),0);DTJZ10:=IF(PL20<REF(PL20,1),COUNT(EN2,走弱3),0);DTJD10:=IF(PL20<REF(PL20,1),COUNT(EX2,走弱3),0);DRAWTEXT(EN1 AND DTJZ5=1,L*0.95,'浪',COLORGREEN;DRAWTEXT(EX1 AND DTJD5=2,H*1.02,'浪',COLORGREEN;DRAWTEXT(EN2 AND ZTJZ5=1,L*0.95,'浪',COLORGREEN;DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJD5=1,H*1.02,'空',COLORYELLOW;DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=2,L*0.98,'多',COLORYELLOW;DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJZ5=2,H*1.02,'空',COLORYELLOW;DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=3,L*0.98,'多',COLORYELLOW;DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.02,'空',COLORYELLOW;DRAWTEXT(EN2 AND DTJZ10=1,L*0.93,'多',COLORFF00FF;DRAWTEXT(EX2 AND DTJD10=2,H*1.01,'空',COLORFF00FF;DRAWTEXT(EN3 AND ZTJZ10=1,L*0.93,'多',COLORFF00FF;DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.06,'空',LINETHICK3,COLOR00FFFF;DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=2,L*0.94,'多',LINETHICK3,COLOR00FFFF;DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=2 OR (ZTJD10=0 OR ZTJD10=2) AND EX2,H*1.06,'空',LINETHICK3,COLOR00FFFF;DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=3,L*0.94,'多',LINETHICK3,COLOR00FFFF;
    走势线:=ZIGZAG(C,3,1);G:=MA(走势线,2);DRAWTEXT(CROSS(走势线,G),L,'',COLORRED;DRAWTEXT(CROSS(G,走势线),H,''),COLORGREEN;支撑位:=IF((走势线-REF(走势线,1))/REF(走势线,1)*100>=0,REF(走势线,BARSLAST(CROSS((走势线-REF(走势线,1))/REF(走势线,1)*100,0))+1),NULL),COLORRED,LINETHICK2;阻力位:=IF((走势线-REF(走势线,1))/REF(走势线,1)*100<0,REF(走势线,BARSLAST(CROSS(0,(走势线-REF(走势线,1))/REF(走势线,1)*100))+1),NULL),COLORBLUE,LINETHICK2;买卖价格位:=MA(C,3);头部:=PEAKBARS(C,3,1,1)=0;底部:=TROUGHBARS(C,3,1,1)=0;DRAWTEXT(头部,H, '----------有阻力 ',COLORGREEN;DRAWTEXT(底部,L, '++++++++有支撑 ',COLORRED;

     

     来源:程序化99

  • 文华技术人员:  您的指标含有未来函数,无法修改为交易模型

     

     来源: WWW.CXH99.COM

  • 文华客服:  去掉未来函数行不?

     

  • 网友回复:  未来函数无法调整为普通函数,因此无法修改

 

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

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

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

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


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

相关文章

    没有相关内容