num:=1;//下单数量
//第二根k线收盘价高于前面一根k线收盘价就开仓做多---平空开多
long:=c>ref(c,1) and time>=090500 and time<145500;
if long then
begin
sellshort(holding<0,num,market);
buy(holding=0,num,market);
end
//如果第二根k线收盘价低于前面一根k线收盘价了就做空,平多开空
short:=c<ref(c,1) and time>=090500 and time<145500;
if short then
begin
sell(holding>0,num,market);
buyshort(holding=0,num,market);
end
//收盘前5分钟平仓
if time >= 145500 then
begin
sell(holding > 0, num, market);
sellshort(holding < 0, num, market);
end