//变量申明 dd:=ref(c,barslast(date>ref(date,1))+1);//昨天的收盘价 aa:=valuewhen(date<>ref(date,1),o);//今天开盘价 //开多仓条件 cod1:=time>=091000 and time<145000 and aa>dd; //语句编写 if cod1 then begin buy(holding=0,1,market); end //开空条件 cod2:=time>=091000 and time<145000 and aa<dd; //语句编写 if cod2 then begin buyshort(holding=0,1,market); end //收盘前平仓 if time>=145000 then begin sell(1,1,market); sellshort(1,1,market); end