/交易时间锁定日内
t1:=time>opentime(1) and time
=closetime(0)-4500;
//交易系统
开多:buy(开多条件 and t1 and cyc>1,手数,market);
开空:buyshort(开空条件 and t1 and cyc>1,手数,market);
收盘平多:sell(t2 and holding>0, 0, thisclose);
收盘平空:sellshort(t2 and holding<0,0,thisclose);
开仓是正常的,但是收盘前没有自动平仓,我想问一下是什么原因?
t2的定义提供下。你平仓条件是包含t2但是你没有提供它的代码定义。
//交易时间锁定日内
t1:=time>opentime(1) and time
=closetime(0)-4500;
//交易系统
开多:buy(开多条件 and t1 and cyc>1,手数,market);
开空:buyshort(开空条件 and t1 and cyc>1,手数,market);
收盘平多:sell(t2 and holding>0, 0, thisclose);
收盘平空:sellshort(t2 and holding<0,0,thisclose);
T2的条件是怎么写的?
该公式运行在什么周期下?
采用的是什么运行模式?
[此贴子已经被作者于2020/3/26 15:58:15编辑过]
t2的定义。不是t1
收盘平多:sell(t2 and holding>0, 0, thisclose);
收盘平空:sellshort(t2 and holding<0,0,thisclose);
不知道t2怎么的定义,没办法判断你的问题。
运行在5分钟周期下//交易时间锁定日内
t1:=time>opentime(1) and time
=closetime(0)-4500;
//交易系统
开多:buy(开多条件 and t1 and cyc>1,手数,market);
开空:buyshort(开空条件 and t1 and cyc>1,手数,market);
收盘平多:sell(t2 and holding>0, 0, thisclose);
收盘平空:sellshort(t2 and holding<0,0,thisclose);
请看清楚4楼的除周期外的另两个问题。
你自己看清楚你代码定义的 t2呢???
[此贴子已经被作者于2020/3/26 16:24:16编辑过]
t2:=time>=closetime(0)-4500;我发现了,不知道为什么t2我发完了却不显示!
t2在最后2个K都会满足的。你看下是不是在倒数第二个K有平仓信号了。