it does not seem to be working properly with this code.
vars: tt(0),size(1),lasttrade(1);
tt=totaltrades;
if tt>tt[1] then begin
if positionprofit(1)>=0 then size=1;
if positionprofit(1)<0 then size=size+1;
end;
buy size contract at highd(0) on stop;
sell size contract at lowd(0)...