Code: Select all
for ii=0 to posTradecount(0)-1
begin
if currentbar-PosTradeentryBar(0,ii)=TimeStop then
Sell ("TimeBarsLX"+Numtostr(ii,0) ) from entry ("Buy"+Numtostr(ii,0)) next bar at market ;
end;
And what's the rationale for not allowing orders inside the loop?