Hi programmers, ive been trying to figure out a way of getting the number of open positions for a specific symbol in an ea for example the number of open positions in USDCHF, does anyone have an idea i'd appreciate any idea on how to start
- Get open positions tickets based on the symbol
- Volume in DOM of open position price
- How to number open trades on chart
Here are all position listed: https://www.mql5.com/en/docs/function_indices.
Search (Ctrl-F) for "open posit" and you'll find PositionsTotal()
![Documentation on MQL5: List of MQL5 Functions Documentation on MQL5: List of MQL5 Functions](https://c.mql5.com/36/53/documentation-on-mql5-list-of-mql5__1.png)
Documentation on MQL5: List of MQL5 Functions
- www.mql5.com
List of MQL5 Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Start with a query for number of open positions, then make a for loop that goes through every position and compares the Symbol with the one you want. Go to documentation and look for functions list. Look for functions that start with Position.
Use the search function to find keywords of your requirements in the documentation and set everything up. When you get stuck ask again.
Edwin Tempah:
Hi programmers, ive been trying to figure out a way of getting the number of open positions for a specific symbol in an ea for example the number of open positions in USDCHF, does anyone have an idea i'd appreciate any idea on how to start
Hi programmers, ive been trying to figure out a way of getting the number of open positions for a specific symbol in an ea for example the number of open positions in USDCHF, does anyone have an idea i'd appreciate any idea on how to start
![How to start with MQL5 How to start with MQL5](https://c.mql5.com/36/53/how-to-start-with-mql5__9.jpg)
How to start with MQL5
- 2020.12.19
- www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
I managed to get the best way of doing it in mql5, so it goes
***
The ea stores the magic number for the symbol it is attached to.
Edwin Tempah # :
I managed to get the best way of doing it in mql5, so it goes
***
The ea stores the magic number for the symbol it is attached to.
1. Please do not confuse two concepts: "Pending Order" and "Position"
2. Please insert the code correctly: when editing a message, press the button and paste your code into the pop-up window
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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