Start to get smart!
Here is the list of all functions: https://www.mql5.com/en/docs/function_indices
Or learn to search (https://www.mql5.com/de/search) as there are lots of code examples ...
- www.mql5.com
Hello
i am new here and just learning
there are already opened positions on mt5
Then my EA opened several positions to buy for example using trade.Buy which is instance of CTrade
and i want to modify certain position (opened with my EA) based on ticket number,
how can i get the ticket number of open positions that was opened with my EA and not other opened positions.
thank you
You need to be able to identify which positions your EA opened - usually one can set a unique magic number at the time of opening to make it easy.
Once that is known, use the Position functions - loop through the positions and select the ones you want - read all the documentation to get an idea.
The standard documentation does not seem to have examples but I wrote something similar for another query, so you can look at that to see how to construct the loop:
https://www.mql5.com/en/forum/429908#comment_41190517
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello
i am new here and just learning
there are already opened positions on mt5
Then my EA opened several positions to buy for example using trade.Buy which is instance of CTrade
and i want to modify certain position (opened with my EA) based on ticket number,
how can i get the ticket number of open positions that was opened with my EA and not other opened positions.
thank you