MC setstoploss止损后。就不能自动开仓了[MCca88会员登录入口手机]

相关标签:期货与期权套利策略 , 期货期权组合策略 , 期权与期货的区别 。 中金所期货期权学院 , 期货期权 2017 , 中国期货期权学院 , 期货期权交易规则 , 期货期权入门 , 期货期权远期 , 期货与期权论文 , 期货期权是何事 , 豆粕期货期权合约机是什么意思 , 期货期权实战2017 。 远期 期货 期权的区别 , 中国何事是金融期货期权学院 ,
? ?? ?下面是我编写的股指期货代码,现在有几个问题想请教一下。
? ?? ?1,以下的代码有无地方可以简化?可以减少计算时间。
? ?? ?2。现在运行中,setstoploss止损后,就不能自动开仓了,如果想止损后依然按环境自动开仓,应有怎么写代码?
? ???非常感谢!




inputs:p01(9999),p02(9999),p03(9999),p04(9999);
variables:co1(0),c02(0),c03(0),c04(0),d01(0),d02(0),d03(0),d04(0);
begin
co1=p01-0.2;
c02=p02-0.2;
c03=p03-0.2;
c04=p04-0.2;
d01=p01+0.2;
d02=p02+0.2;
d03=p03+0.2;
d04=p04+0.2;
if close cross above co1 and marketposition=0 then sellshort 1 contract next bar at market;
if close cross above c02 and marketposition=0 then sellshort 1 contract next bar at market;
if close cross above c03 and marketposition=0 then sellshort 1 contract next bar at market;
if close cross above c04 and marketposition=0 then sellshort 1 contract next bar at market;
if close cross under d01 and marketposition=0 then buy 1 contract next bar at market;
if close cross under d02 and marketposition=0 then buy 1 contract next bar at market;
if close cross under d03 and marketposition=0 then buy 1 contract next bar at market;
if close cross under d04 and marketposition=0 then buy 1 contract next bar at market;
if close cross above co1 and marketposition=1 then sellshort 1 contracts next bar at market;
if close cross above c02 and marketposition=1 then sellshort 1 contracts next bar at market;
if close cross above c03 and marketposition=1 then sellshort 1 contracts next bar at market;
if close cross above c04 and marketposition=1 then sellshort 1 contracts next bar at market;
if close cross above d01 and marketposition=-1 then buy 1 contract next bar at market;
if close cross above d02 and marketposition=-1 then buy 1 contract next bar at market;
if close cross above d03 and marketposition=-1 then buy 1 contract next bar at market;
if close cross above d04 and marketposition=-1 then buy 1 contract next bar at market;
if close cross under co1 and marketposition=1 then sellshort 1 contract next bar at market;
if close cross under c02 and marketposition=1 then sellshort 1 contract next bar at market;
if close cross under c03 and marketposition=1 then sellshort 1 contract next bar at market;
if close cross under c04 and marketposition=1 then sellshort 1 contract next bar at market;
if close cross under d01 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross under d02 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross under d03 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross under d04 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross above d01 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross above d02 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross above d03 and marketposition=-1 then buy 1 contracts next bar at market;
if close cross above d04 and marketposition=-1 then buy 1 contracts next bar at market;
setstoploss(600);
if time>=1457 then
sell next bar at market;
buytocover next bar at market;
end
?

?

?

ca88会员登录入口手机导入教程: 【通达信ca88会员登录入口手机ca88会员登录入口手机导入方法教程】 【同花股票顺ca88会员登录入口手机ca88会员登录入口手机导入方法教程】 【大智慧新一代迈腾ca88会员登录入口手机ca88会员登录入口手机导入方法教程

?

 

想编写各种ca88会员登录入口手机ca88会员登录入口手机,简单化交易模型,预警ca88会员登录入口手机的朋友

可挂钩技术人员 QQ: 511411198  进行 在职教师有偿补课 编写!不贵!点击查看价格!

 


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

相关文章

    没有相关情节
 
Baidu