Hi Everyone,
My EA code open a position using Trade.Buy(lotsize,_Symbol,Ask,0,tp) without any stop loss but having a tp price.
When certain conditions are met, i would like to remove the tp by using Trade.PositionModify(ticket,0,0) but EA keep producing failed modify [Invalid stops] error.
Does anyone have any solution to this ? My requirement is straight forward but does not seems to have a solution.
Traders and coders are working for free:
- if it is interesting for them personally, or
- if it is interesting for many members on this forum.
Freelance section of the forum should be used in most of the cases.

- 2025.06.23
- www.mql5.com
Hi Everyone,
My EA code open a position using Trade.Buy(lotsize,_Symbol,Ask,0,tp) without any stop loss but having a tp price.
When certain conditions are met, i would like to remove the tp by using Trade.PositionModify(ticket,0,0) but EA keep producing failed modify [Invalid stops] error.
Does anyone have any solution to this ? My requirement is straight forward but does not seems to have a solution.
you probably forgot to select the position first with PositionGetTicket() and then PositionSelectByTicket(). After that then you can feed Trade.PositionModify(ticket, 0,0 or whatever)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Everyone,
My EA code open a position using Trade.Buy(lotsize,_Symbol,Ask,0,tp) without any stop loss but having a tp price.
When certain conditions are met, i would like to remove the tp by using Trade.PositionModify(ticket,0,0) but EA keep producing failed modify [Invalid stops] error.
Does anyone have any solution to this ? My requirement is straight forward but does not seems to have a solution.