思路:开盘同时开多开空各1手,15点止损,不止盈。收盘平仓。
代码:
buy(1,1,limitr,open);
buyshort(1,1,limitr,open);
if l<open-15 then sell(1,1,limitr,open-15);
if h>open+15 then sellshort(1,1,limitr,open+15);
if holding>0 then sell(1,1,thisclose);
if holding<0 then sellshort(1,1,thisclose);
为啥执行过程中,忽略了开空信号?
代码就是这样写的?
那么原因就是,金字塔图表交易不能对锁,所以在有多仓的情况下,无法开空仓
如果是因为无法对锁的原因,那么这个策略就无法用金字塔测试了