Use (for i = OrdersTotal()-1; i >= 0; i--)
when you close an order, OrdersTotal() becomes smaller.
If you have trades a, b and c, OT = 3
Close a, now OT = 2
and you miss closing b in your loop because b is "order #0"
when you close an order, OrdersTotal() becomes smaller.
If you have trades a, b and c, OT = 3
Close a, now OT = 2
and you miss closing b in your loop because b is "order #0"
Use (for i = OrdersTotal()-1; i >= 0; i--)
when you close an order, OrdersTotal() becomes smaller.
If you have trades a, b and c, OT = 3
Close a, now OT = 2
and you miss closing b in your loop because b is "order #0"
when you close an order, OrdersTotal() becomes smaller.
If you have trades a, b and c, OT = 3
Close a, now OT = 2
and you miss closing b in your loop because b is "order #0"
Duh! - hell could have frozen over and that wouldn't have occurred to me :D
Thanks, it is really, really appreciated :)
Caught me in the beginning, too
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
Is this something obvious I am overlooking or is this another Metatrader bug???