hi guys, i need to find index of selected order in history trades.do u know any function for it?
But you already know the "index". It is one of the parameters for the OrderSelect ...
If that is not it, then please explain in more detail and provide example code. We cannot read your mind nor see your computer.bool OrderSelect( int index, // index or order ticket int select, // flag int pool=MODE_TRADES // mode );
How can you select an order without knowing the index?
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
We can't see your broken code.
Always post all relevant code (using Code button) or attach the source file.
If you mean that you are selecting an order by ticket number and then wishing to know the index in the order pool, then that is not possible (nor reliable).
This is because you don't know from which pool the ticket is from—the pool of current orders or from the history pool.
Based on whether it is closed or not, you can then loop through the respective pool and find the matching order ticket for the index being selected.
However, the indexing is not reliable as an identifier, because any order closed or deleted will alter the indexing position of the rest of the orders.
Indexing can only be used temporarily. Change the logic of your code so as not to depend on the index.
How can you select an order without knowing the index?
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
We can't see your broken code.
Always post all relevant code (using Code button) or attach the source file.
If you mean that you are selecting an order by ticket number and then wishing to know the index in the order poll, then that is not possible (nor reliable).
This is because you don't know if from which pool the ticket is from—the pool of current orders or from the history pool.
Based on whether it is closed or not, you can then have to loop through the respective pool and find the matching order ticket for the index being selected.
However, the indexing is not reliable as an identifier, because any order closed or deleted will alter the indexing position of the rest of the orders.
Indexing can only be used temporarily. Change the logic of your code so as not to depend on the index.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use