【MultiCharts(MC)程序化(量化)网上培训学习系列】第84节:股指主力合约与指数结合设计进出点策略程式码及回测效果
[attach]24564[/attach][size=14.4px]1、效果图;[/size]
[size=14.4px]2、通过[/size][size=14.4px]期货[/size][size=14.4px]论坛推荐新开立期货账号享受特惠政策:[/size][url=http://www.qhlt.cn/thread-25049-1-1.html]http://www.qhlt.cn/thread-25049-1-1.html[/url][size=14.4px];[/size]
[size=14.4px]3、通过期货论坛开立期货账号并绑定MC享受专属优惠政策:[/size][url=http://www.qhlt.cn/thread-80442-1-1.html]http://www.qhlt.cn/thread-80442-1-1.html[/url][size=14.4px];[/size]
[size=14.4px]4、代写与求助:[/size][url=http://www.qhlt.cn/forum-109-1.html]http://www.qhlt.cn/forum-109-1.html[/url][size=14.4px];[/size]
[size=14.4px]5、期货论坛[/size][size=14.4px]策略[/size][size=14.4px]源码[/size][size=14.4px]区:[/size][url=http://www.qhlt.cn/forum-109-1.html]http://www.qhlt.cn/forum-109-1.html[/url][size=14.4px] ;[/size]
[size=14.4px]6、期货论坛官方MC[/size][size=14.4px]量化[/size][size=14.4px]策略群,对视频中策略有想法、建议、优化以结交量化好友,动动手,扫二维码加入微信群,跟一众量化好友切磋吧[/size] 视频地址:[mp4]http://mp4.qhlt.club/Rec%200084.mp4[/mp4] 视频中策略程式码部分:
**** Hidden Message ***** 策略在IF2011合约5分钟线图上面运行效果及回测
[attach]24565[/attach]
[attach]24566[/attach] 策略在IF2011合约1分钟线图上面运行效果及回测
[attach]24567[/attach]
[attach]24568[/attach] 简评:
这个策略仍然有些不完整,今天白天优化好,也欢迎网友一起优化。 进行了修正 ,加了下午三点之前5分钟出场
[code]
Input:len(20);
var:mp(0);
mp = marketposition * currentcontracts;
condition1 = Close < Close of data2;
condition2 = Close > Close of data2;
condition3 = Average(close,len) > Average(close,len)[1];
condition4 = Average(close,len) < Average(close,len)[1];
condition51 = Close < entryprice(0);
condition52 = Close > entryprice(0);
if condition1 and condition3 then buy("L_E") next bar at Highest(high,len) stop;
if condition2 and condition4 then sellshort("S_E") next bar at Lowest(low,len) stop;
//time-exit model
if Time>1455 and time <1500 then begin
if mp=-1 then buytocover("short-exit at 14:55")1 shares next bar at market;
if mp= 1 then sell("long-exit at 14:55")1 shares next bar at market;
end;
if Time>2255 and time <2300 then begin
if mp=-1 then buytocover("short-exit at 22:55") 1 shares next bar at market;
if mp= 1 then sell("long-exit at 22:55") 1 shares next bar at market;
end;
[/code] 在股指2011上面1分钟线图
[attach]24645[/attach] 感谢版主分享 谢谢分享
页:
[1]