There is your bug not platform. Use loop from end to begin
for(counter=tradePoolSize-1;counter>=0;counter--)

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.