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
Ok ... This I understood. However, my question was different from what you exposed.
If the order is there "somewhere"and I cannot see it, how can I delete it?
My delete_orders() is only getting the orders I see on my trade tab so I understand that I am using a wrong process to "visualize/ delete this order".
IOW, I understood the order is there. How can I catch/ reach it?
You are using MqlTradeRequest, and in this case you have to use the option
mrequest.action=TRADE_ACTION_SLTP;
if you want to delete or modify your stop loss (or take profit). Please take a look at the possible trade request actions.
In my opinion, It would be easier to use the PositionModify function, found in the CTrade Standard Library.
FIRST
Ok ... This I understood. However, my question was different from what you exposed.
If the order is there "somewhere"and I cannot see it, how can I delete it?
My delete_orders() is only getting the orders I see on my trade tab so I understand that I am using a wrong process to "visualize/ delete this order".
IOW, I understood the order is there. How can I catch/ reach it?
From the screenshot you posted, you don't have any order. You have a position with an SL and a TP. As already said, SL/TP are processed separately with MT5, they are not pending orders.
So once you have a position with an SL/TP, you can modify this SL/TP by modifying the position, see TRADE_ACTION_SLTP.