请问老师语句怎么写,平仓条件如下:
如果当天收盘前10分钟时盈利超过1%那么就等到第二天10点钟平仓,如果当天在收盘前10分钟时盈利小于1%那么就当天平仓。
if (valuewhen(time0=timetot0(closetime(0))-60*10,asset)-ref(asset,todaybar))/ref(asset,todaybar)<0.01 then begin
sell(1,0,marketr);
sellshort(1,0,marketr);
end
if ref((valuewhen(time0=timetot0(closetime(0))-60*10,asset)-ref(asset,todaybar))/ref(asset,todaybar)>=0.01 ,todaybar) and time=100000 then begin
sell(1,0,marketr);
sellshort(1,0,marketr);
end