| 

 等级: 新手上路 
注册: 2022-2-4曾用名:  | 
 
 
 楼主|
发表于 2022-2-5 23:05
|
显示全部楼层 
| //交易条件 开多条件:=c>上轨 and T0TOTIME(TIMETOT0(CLOSETIME(0))-60*15)>DYNAINFO(207) and holding<=0;//最晚开仓在收盘前15分钟
 开空条件:=c<下轨 and T0TOTIME(TIMETOT0(CLOSETIME(0))-60*15)>DYNAINFO(207) and holding>=0;
 
 //交易系统
 开多:buy(开多条件 and cyc>1,ss,market);
 开空:buyshort(开空条件 and cyc>1,ss,market);
 平多:sell(c<上轨 and holding>0, 0, market);
 平空:sellshort(c>下轨 and holding<0,0,market);
 
 // 收盘前清仓
 if  T0TOTIME(TIMETOT0(CLOSETIME(0))-60*5)<=DYNAINFO(207) or (time=190000 and not(ISLASTBAR)) then begin
 sell(1,holding,MARKET);
 sellshort(1,holding,MARKET);
 end
 | 
 |