-- 改为限价交易
老师好.如下模型请改为限价交易.用收盘价.并加1跳开平仓.谢谢!!
buycond:=ref(count(c>o,3)=3,1);
sellcond:=ref(count(c<o,3)=3,1);
if holding<0 and buycond then sellshort(1,1,MARKETR);
if buycond and holding=0 then
begin
buy(1,1,MARKETR);
end
if holding>0 and sellcond then sell(1,1,MARKETR);
if holding=0 and sellcond then buyshort(1,1,MARKETR);
SELL(((TIME>=151450) and (HOLDING>0)),SS,MARKET);
SELLSHORT(((TIME>=151450) and (HOLDING<0)),SS,MARKET);