VARIABLE:n=0;
if buycond and n<2 then beign
buy();
end
if sellcond then begin
sell();
if NUMPROFIT(1)<0 then n:=n+1;
if NUMPROFIT(1)>0 then n:=0;
end
if time=CLOSETIME(0) then n:=0;
VARIABLE:n=0;
if buycond and n<2 then beign
buy();
end
if sellcond then begin
sell();
if NUMPROFIT(1)<0 then n:=n+1;
if NUMPROFIT(1)>0 then n:=0;
end
if time=CLOSETIME(0) then n:=0;