You have to loop through all positions and count them individually.
For an example of such a loop search here for PositionsTotal and select CodeBase..
frbud:
Hi All,
I tried to make 1 EA which need to detect the PositionsTotal by currency pair.
How to coding the PositionsTotal to detect the total of open position by currency pair.
I.e, EURUSD detect 1 open position, USDCHF detect 1 open position. Currently they give values 2 open position.
Please kindly help, thanks in advace.
Example: Calculate Positions and Pending Orders
How to start with MQL5
- 2020.03.12
- www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
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
Hi All,
I tried to make 1 EA which need to detect the PositionsTotal by currency pair.
How to coding the PositionsTotal to detect the total of open position by currency pair.
I.e, EURUSD detect 1 open position, USDCHF detect 1 open position. Currently they give values 2 open position.
Please kindly help, thanks in advace.