if high>=N and vol<ref(vol,1) then //高点
begin
sell(holding>0,holding,MARKET);
buyshort(holding=0,1,MARKET);
end
if low<M and vol<ref(vol,1) then //低点
begin
sellshort(holding<0,holding,MARKET);//不知道你别的地方可有平仓语句,你视情况选择保留这里的平仓与否,下面的类似。图表下是不能锁仓的。
buy(holding=0,1,MARKET);
end