等级: 免费版
- 注册:
- 2022-4-2
- 曾用名:
|

楼主 |
发表于 2022-6-21 12:57
|
显示全部楼层
例如下面两个交易系统都带有时间止损,但是写在一个策略里就不好弄了。请问怎么处理好些
//交易系统1
买开1:buy(condbuy1,lot,thisclose); //开仓1
买开2:buy(condbuy2,lot,thisclose); //开仓2
卖平1:sell(condsp1,lot,thisclose); //平仓1
卖平2:sell(condsp2,lot,thisclose); //平仓2
卖出止损:sell(sellzs,holding,thisclose); //卖出止损
卖开1:buyshort(condsel1,lot,thisclose); //开仓1
卖开2:buyshort(condsel2,lot,thisclose); //开仓2
买平1:sellshort(condbp1,lot,thisclose); //平仓1
买平2:sellshort(condbp2,lot,thisclose); //平仓2
买入止损:sellshort(buyzs,holding,thisclose); //买入止损
//交易系统2
买开m1:buy(condbuym1,lot,thisclose); //开仓1
买开m2:buy(condbuym2,lot,thisclose); //开仓2
卖平m1:sell(condspm1,lot,thisclose); //平仓1
卖平m2:sell(condspm2,lot,thisclose); //平仓2
卖出止损m:sell(sellzsm,holding,thisclose); //卖出止损
卖开m1:buyshort(condselm1,lot,thisclose); //开仓1
卖开m2:buyshort(condselm2,lot,thisclose); //开仓2
买平m1:sellshort(condbpm1,lot,thisclose); //平仓1
买平m2:sellshort(condbpm2,lot,thisclose); //平仓2
买入止损m:sellshort(buyzsm,holding,thisclose); //买入止损
spcond :=ENTERBARS>=x &&holding>0;
bpcond :=ENTERBARS>=x &&holding<0;
时间止损卖:sell(spcond,holding,thisclose);
时间止损买:sellshort(bpcond,holding,thisclose); |
|