开多条件,如果昨天是阴线(C<O),就以开盘价买入,收盘价平仓;
开空条件,如果昨天是阳线(C>O),就以开盘价卖出,收盘价平仓;
if ref(c<o,1) then buy(1,1,o);
if ref(c>o,1) then buyshort(1,1,o);
if time>145500 then
begin
sell(1,1,mkt);
sellshort(1,1,mkt);
end
if ref(c<o,1) then buy(1,1,o);
if ref(c>o,1) then buyshort(1,1,o);
改成
if ref(c<o,1) then buy(1,1,limitr,o);
if ref(c>o,1) then buyshort(1,1,limitr,o);
if ref(c<o,1) then begin
buy(1,1,limit,o);
sell(1,1,limit,close);
end
if ref(c>o,1) then begin
buyshort(1,1,limit,o);
sellshort(1,1,limit,close);
end