麻烦老师帮忙转换一下,谢谢 [文华财经]
-
咨询内容:
PARAMSNUMERIC NOTBEF(9.00);NUMERIC NOTAFT(14.55);NUMERIC F1(0.01);NUMERIC F2(1);NUMERIC F3(0.01);NUMERIC REVERSE(1.00);NUMERIC RANGEMIN(0.1);NUMERIC XDIV(3);NUMERIC OFFSET(5);VARSNUMERICSERIES SSETUP(0);NUMERICSERIES BSETUP(0);NUMERICSERIES SENTER(0);NUMERICSERIES BENTER(0);NUMERICSERIES BBREAK(0);NUMERICSERIES SBREAK(0);NUMERICSERIES LTODAY(0);NUMERICSERIES HITODAY(9999);NUMERICSERIES STARTNOW(0);NUMERICSERIES DIV(0);BOOLSERIES RFILTER(FALSE);NUMERIC I_REVERSE;NUMERIC I_RANGEMIN;NUMERIC I_VB;NUMERIC I_VS;NUMERIC I_OFFSET;NUMERIC OFFSET2;BEGINIF(BARSTATUS==2 && TIME==0.090000 && HIGH==LOW ) RETURN; I_OFFSET = OFFSET*MINMOVE*PRICESCALE;I_REVERSE = REVERSE*(OPEND(0)/100);I_RANGEMIN = RANGEMIN*(OPEND(0)/100);IF(BARSTATUS==0){ STARTNOW=0;DIV=MAX(XDIV,1);}IF(DATE != DATE[1]){ SETGLOBALVAR(0,0);// 将第1个全局变量设置为0,将第2个全局变量设置为0 SETGLOBALVAR(1,0); STARTNOW=STARTNOW+1; SSETUP=HITODAY[1]+F1*(CLOSE[1]-LTODAY[1]); SENTER=((1+F2)/2)*(HITODAY[1]+CLOSE[1])-(F2)*LTODAY[1]; BENTER=((1+F2)/2)*(LTODAY[1]+CLOSE[1])-(F2)*HITODAY[1]; BSETUP=LTODAY[1]-F1*(HITODAY[1]-CLOSE[1]); BBREAK=SSETUP+F3*(SSETUP-BSETUP); SBREAK=BSETUP-F3*(SSETUP-BSETUP); HITODAY=HIGH; LTODAY=LOW; RFILTER=(HITODAY[1]-LTODAY[1])>=I_RANGEMIN;}IF(HIGH>HITODAY){ HITODAY=HIGH;}IF(LOW<LTODAY){ LTODAY=LOW;}IF(TIME*100>NOTBEF AND TIME*100<NOTAFT AND STARTNOW>=2 AND RFILTER)//当前公式应用商品在当前BAR的时间乘以100》=9点或者小于14.55分{ IF(TIME != GETGLOBALVAR(1) AND GETGLOBALVAR(1) != 0) { SETGLOBALVAR(1,10000); } IF(HITODAY>=SSETUP AND MARKETPOSITION>-1 AND GETGLOBALVAR(1)<1) {IF(LOW<=(SENTER+(HITODAY-SSETUP)/DIV)) { SELLSHORT(1,SENTER+(HITODAY-SSETUP)/DIV+I_OFFSET); SETGLOBALVAR(1,TIME); RETURN;}} IF(LTODAY<=BSETUP AND MARKETPOSITION<1 AND GETGLOBALVAR(1)<1) { IF(HIGH>=(BENTER-(BSETUP-LTODAY)/DIV)) { BUY(1,BENTER-(BSETUP-LTODAY)/DIV-I_OFFSET); SETGLOBALVAR(1,TIME); RETURN; }}
IF(MARKETPOSITION==-1) { SETGLOBALVAR(0,1); IF(HIGH-ENTRYPRICE>=I_REVERSE) { BUYTOCOVER(1,ENTRYPRICE); RETURN;}} IF(MARKETPOSITION==1) { SETGLOBALVAR(0,1); IF(ENTRYPRICE-LOW>=I_REVERSE) { SELL(1,ENTRYPRICE); RETURN;}} IF(MARKETPOSITION==0) { IF(HIGH>=BBREAK AND GETGLOBALVAR(0) == 0) { BUY(1,BBREAK-I_OFFSET); RETURN; }} IF(MARKETPOSITION==0) { IF(LOW<=SBREAK AND GETGLOBALVAR(0) == 0) {SELLSHORT(1,SBREAK+I_OFFSET); RETURN; } }}
IF(TIME*100>=NOTAFT AND TIME<0.1600){ IF(MARKETPOSITION==-1) { BUYTOCOVER(1,OPEN); } IF(MARKETPOSITION==1) { SELL(1,OPEN);}}END来源:程序化99
-
文华技术人员:
需要在MQ软件上查看,MQ是收费软件,官网下载
https://www.wenhua.com.cn/
Params Numeric NOTBEF(9); Numeric F2(1); Numeric RR(1); Numeric XDIV(3); Numeric OFFSET(5); Vars Numeric NOTAFT(14.55); Numeric F3(0.01); Numeric F1(0.01); Numeric RANGEMIN(0.1); NumericSeries SSETUP(0); NumericSeries BSETUP(0); NumericSeries SENTER(0); NumericSeries BENTER(0); NumericSeries BBREAK(0); NumericSeries SBREAK(0); NumericSeries LTODAY(0); NumericSeries HITODAY(9999); NumericSeries STARTNOW(0); NumericSeries DIV(0); NumericSeries RFILTER(0); Numeric I_RR; Numeric I_RANGEMIN; Numeric I_VB; Numeric I_VS; Numeric I_OFFSET; Numeric OFFSET2; BEGIN IF(BARSTATUS==2 && TIME==0.090000 && HIGH==LOW ) I_OFFSET = OFFSET*MINMOVE*PRICESCALE; I_RR = RR*(OPEND(0)/100); I_RANGEMIN = RANGEMIN*(OPEND(0)/100); IF(BARSTATUS==0) { STARTNOW=0; DIV=MAX(XDIV,1); } IF(DATE != DATE[1]) { SETGLOBALVAR(0,0);// 将第1个全局变量设置为0,将第2个全局变量设置为0 SETGLOBALVAR(1,0); STARTNOW=STARTNOW+1; SSETUP=HITODAY[1]+F1*(CLOSE[1]-LTODAY[1]); SENTER=((1+F2)/2)*(HITODAY[1]+CLOSE[1])-(F2)*LTODAY[1]; BENTER=((1+F2)/2)*(LTODAY[1]+CLOSE[1])-(F2)*HITODAY[1]; BSETUP=LTODAY[1]-F1*(HITODAY[1]-CLOSE[1]); BBREAK=SSETUP+F3*(SSETUP-BSETUP); SBREAK=BSETUP-F3*(SSETUP-BSETUP); HITODAY=HIGH; LTODAY=LOW; RFILTER=(HITODAY[1]-LTODAY[1])>=I_RANGEMIN; } IF(HIGH>HITODAY) { HITODAY=HIGH; } IF(LOW<LTODAY) { LTODAY=LOW; } IF(TIME*100>NOTBEF AND TIME*100<NOTAFT AND STARTNOW>=2 AND RFILTER)//当前公式应用商品在当前BAR的时间乘以100》=9点或者小于14.55分 { IF(TIME != GETGLOBALVAR(1) AND GETGLOBALVAR(1) != 0) { SETGLOBALVAR(1,10000); } IF(HITODAY>=SSETUP AND MARKETPOSITION>-1 AND GETGLOBALVAR(1)<1) {IF(LOW<=(SENTER+(HITODAY-SSETUP)/DIV)) { SELLSHORT(1,SENTER+(HITODAY-SSETUP)/DIV+I_OFFSET); SETGLOBALVAR(1,TIME); RETURN; }} IF(LTODAY<=BSETUP AND MARKETPOSITION<1 AND GETGLOBALVAR(1)<1) { IF(HIGH>=(BENTER-(BSETUP-LTODAY)/DIV)) { BUY(1,BENTER-(BSETUP-LTODAY)/DIV-I_OFFSET); SETGLOBALVAR(1,TIME); }}
IF(MARKETPOSITION==-1) { SETGLOBALVAR(0,1); IF(HIGH-ENTRYPRICE>=I_RR) { BUYTOCOVER(1,ENTRYPRICE); RETURN; }} IF(MARKETPOSITION==1) { SETGLOBALVAR(0,1); IF(ENTRYPRICE-LOW>=I_RR) { SELL(1,ENTRYPRICE); RETURN; }} IF(MARKETPOSITION==0) { IF(HIGH>=BBREAK AND GETGLOBALVAR(0) == 0) { BUY(1,BBREAK-I_OFFSET); }} IF(MARKETPOSITION==0) { IF(LOW<=SBREAK AND GETGLOBALVAR(0) == 0) {SELLSHORT(1,SBREAK+I_OFFSET); } }}
IF(TIME*100>=NOTAFT AND TIME<0.1600) { IF(MARKETPOSITION==-1) { BUYTOCOVER(1,OPEN); } IF(MARKETPOSITION==1) { SELL(1,OPEN); }} END
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,谢谢您!)
相关文章
-
没有相关内容