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
It needs to decrement if it closes an order to match what happens in the pool but not if it doesn't close an order. If it decrements without closing an order it goes into an endless loop.
If you didn't keep calling OrdersTotal() you wouldnt have that problem. Call the total once. Put it in a int. Use that int in the for loop.
Having said that did you even read my earlier reply ? That entire loop is a complete waste of time. Look at your code. What do you think the value of SellTicket already is ?
Yes it does, and it is not logical to have already had the neccessary values in the EA then forget them and trawl through the orders pool to retrieve them. That kind of thing only needs to be done as part of reboot recovery.