OrderClose - Error 4051
for(int i=OrdersTotal();i>0; i--)
Change to
for(int i=OrdersTotal()-1;i>=0; i--)
.
for(int i = 0; i < OrdersTotal(); i++)
i should be 0 and count upto OrdersTotal()
Just so you know, your OrderSelect(i, SELECT_BY_POS) starts from 0, if you have 1 order, selecting order 1 wont exist because its indexed from 0 like most arrays.
Keelan:
for(int i = 0; i < OrdersTotal(); i++)
i should be 0 and count upto OrdersTotal()
Absolutely not!!
When closing orders ALWAYS count down.
Thanks.
Why? i iterate through my Orders in ascending order and nothings broke yet, dont have to use FIFO or LIFO? or is it an mql thing?
there is a function to selecting a symbol :
SymbolSelect();
i dont know how to use it in order to select for example EURUSD symbol, can you please write exactly the code which select the symbol EURUSD ?
thanks
there is a function to selecting a symbol :
SymbolSelect();
idont know how to use it in order to select for example EURUSD symbol,can you please write exactly the code which select the symbol EURUSD ?
thanks
I am wasting a lot of time deleting your replicated posts.
Don't double post
You are banned for 1 month and lucky that it is not permanent!
Hi there,
I manually opened a BUY order and ran the below code:
It generated the below output:
The trade tab shows an active order of 0.01 lots:
What changes do I need to make to be able to delete active orders please?
Kind regards.