So that means you don't have a position on this symbol at this moment.
This code is run when the EA receive an event that an order had been added to history, which doesn't mean you should have a position. What is the problem ?
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 use above code to get the position in OnTradeTransaction() handler. Most of the time, it works well. But I PositionSelect(Symbol()) always fails on 1999.06.09 EURUSD data during the test. The error code is: 4753, and I can't find any explanation.
Can you please tell me why PositionSelect() fails? Thanks!