variable:n=close;
if close>n+20*mindiff and holding=0 then begin
buy(holding=0,1,market);
n:=close;
end
if close<n-20*mindiff and holding=0 then begin
buyshort(holding=0,1,market);
n:=close;
end
variable:n=close;
if close>n+20*mindiff then begin
sellshort(1,0,market);
buy(holding=0,1,market);
n:=close;
end
if close<n-20*mindiff then begin
sell(1,0,market);
buyshort(holding=0,1,market);
n:=close;
end