You have to select the position before getting any of its properties.
for (int i = PositionsTotal() - 1; i >= 0; i--) { ulong ticket = PositionGetTicket(i); if (PositionSelectByTicket(ticket)) { //... your code here

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,
First post here, and sorry in advance because i will my problem is trivial...
I have this code and don't understand why I get only "0" values for all the data I try to get back from my opened positions.
If someone can help, thank you in advance.