My EA is not closing the intended trades. It gets the wrong type of position ticket. How can i get the correct one?
okay. i solved it.
Just changed the deal ticket to order ticket.
second last line to result.order and it is working fine in live trading.
However, at both instances my EA worked fine with backtesting, don't know why.
saurabhsuman003 #:
okay. i solved it.
Just changed the deal ticket to order ticket.
second last line to result.order and it is working fine in live trading.
However, at both instances my EA worked fine with backtesting, don't know why.
Thank you so much this is the answer matched my case too.

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 used the above code to store ticket of a position. the ticket stored was 210877044 while that shown beside position was 210921939. The journal shows both of them related to same market order.
perhaps,because of this confusion my EA is not closing any trades.
moreover it worked fine while backtesting, and this error poped up during testing on a demo account.
what can i do to get the ticket number shown beside my position in trade-toolbox window.