- cannot detect new bar form.
- CTrade Stop Loss trigger
- CTrade Stop Loss trigger
Incoming tick cannot interrupt EA execution.
BTW for closing positions You need to use backward loop
for(cnt=OrdersTotal(); cnt>=0; cnt--)
I am looping backward (that took me a couple tries to figure that out, for some reason, it closed about half of the orders (It would skip every other one...)) I have added the RefreshRates to the function, and it seems to have fixed the issue, thanks a ton!
Incoming tick cannot interrupt EA execution.
BTW for closing positions You need to use backward loop
for(cnt=OrdersTotal(); cnt>=0; cnt--)
Maybe I have missed above concept in MQL4 docs. If not documented, is this not VIP info?
I read many https://www.mql5.com/en/articles/mt4/ articles and some use 0..OrdersTotal()-1 and others use OrdersTotal()-1..0
without further clarification + background info, it is not possible to understand your comment.
Could you please explain why you say this? ie, some background info to hang your comment onto and make sense of it would be appreciated.
If is FILO queue/stack I could understand.
However, if must do this then orders in trade pool must have positional significance, yes?
This would then indicate that closing order 'positioned' within[notAtTopOf] trade pool queue is not allowed and also that many https://www.mql5.com/en/articles/mt4/ are incorrect.
BTW for closing positions You need to use backward loop
for(cnt=OrdersTotal(); cnt>=0; cnt--)
Maybe I have missed above concept in MQL4 docs. If not documented, is this not VIP info?
I read many https://www.mql5.com/en/articles/mt4/ articles and some use 0..OrdersTotal()-1 and others use OrdersTotal()-1..0
without further clarification + background info, it is not possible to understand your comment.
Could you please explain why you say this? ie, some background info to hang your
comment onto and make sense of it would be appreciated.
But for those who maintains many open orders, this small thing becomes important.
Myself prefers a safer and clearer structure below
int total = OrdersTotal(); // then the following structure be the same as... for( int count = 0; count < total; count++ ) ... // ...the same as this one below... for( int count = total-1; count >= 0; count++ ) ...The problem is at the repeated calls to OrdersTotal() DURING OrderClose()-ing makes the value of OrdersTotal() changes!!!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use