I suppose it's an hedging account. In this case to modify an existing position you need to specify the ticket.
request.action = TRADE_ACTION_SLTP;
request.position = result.order;
You should better add your sl/tp to your initial order.
Alain Verleyen:
Thanks for your help and fast reply.
I suppose it's an hedging account. In this case to modify an existing position you need to specify the ticket.
You should better add your sl/tp to your initial order.
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
Subject: Error message: failed modify #2 sell 0.10 EURUSD sl: 0.00000, tp: 0.00000 -> sl: 1.22924, tp: 1.20924 [Position doesn't exist]
Hi,
I''m new to mql5 and I'm having an issue getting the same error message over and over again no matter what I try.
I have not been able to find any previous posts with a solution that works for me on this.
2018.04.02 15:23:27.594 2018.03.01 00:00:00 failed modify #2 sell 0.10 EURUSD sl: 0.00000, tp: 0.00000 -> sl: 1.22924, tp: 1.20924 [Position doesn't exist]
Above is the code I have so far, the EA is incomplete yet but that is everything I have for now and when I run it I get the above error message. I have tried modifying the sl and tp after the trade is placed with the code from the "Expert Advisor Programming for metatrader 5" book and I still get the same error when I do this so I think the error must be in the above code somewhere.
Any help would be greatly appreciated.
Thanks for taking the time to read this.
Steve