PositionsTotal();
https://www.mql5.com/en/docs/trading/positionstotal
Documentation on MQL5: Trade Functions / PositionsTotal
- www.mql5.com
Trade Functions / PositionsTotal - Reference on algorithmic/automated trading language for MetaTrader 5
Ah - I understand.
Coming from MQL4 I was baffled by the example in the reference:
uint total=OrdersTotal(); //--- gehen wir im Zyklus durch alle Ordern for(uint i=0;i<total;i++) { //--- erhalten wir Orderticket in Bezug auf seine Position in der Liste if((ticket=OrderGetTicket(i))>0) { ....
Carl Schreiber:
Ah - I understand.
Coming from MQL4 I was baffled by the example in the reference:
In MQL5 OrdersTotal() returns count of pending orders.
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
I have on a demo account 13 open positions:
but OrdersTotal() shows zero(?):
How do you get the open positions in MQL5?