TradePool messing things
There is your bug not platform. Use loop from end to begin
for(counter=tradePoolSize-1;counter>=0;counter--)
for(counter=tradePoolSize-1;counter>=0;counter--)
You agree to website policy and terms of use
When running testing i got thinks really weird like you can see in log line 39 and 40 when the position have his OrderSymbol() equals "", then when forced to close, his ticket number is #0 and cannot be closed.
Here is the full log: http://rafb.net/paste/results/V8knvL55.html
I am thinking this a platform bug.