Don't mix a position and an order. They are different. You can have only one open position and many orders. See HistorySelect.
Maybe your problem is because you are using OrdersTotal() as in mql4, instead of PositionsTotal(). See PositionsTotal().
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 opened an buy-order, confirmed by the server and running.
int x = OrdersTotal();
x = 1
x = 0
x = 0 ........
OrdersTotal() returns first 1, then 0, although there is an open position.