Please help me how to resend pending order?
-
lf pending order active then price going to stoploss.
l want lt to re open pending order (same last order).
(If order tap stoploss EA will re open pending order again again).How to do it?
https://fxdreema.com/shared/XolEYQuee
Sorry for my English
Thank you very much -
What is closed by SL is the trade that is result from your pending order, so you are going to work with it. There are different ways to do that.
-
Use "on Trade" event to detect when the trade is closed by SL. The downside is that this event is generated by the EA in the moment when the trade is closed, so if for some reason the EA is not working at that moment (you have closed MT or remover the EA from the chart), the event will be missed.
-
Do it under "on Tick". You can check if there is no trade at the moment, then check the last closed trade - if it was closed on loss, create new pending order using the same parameters from that closed trade (Open price, SL, TP and lot size). There are no events you can miss here, but imagine if you close the EA for some hours and then run it again - it will create a pending order where the last closed trade was, but hours later the price will be... who knows where.
-
-
https://fxdreema.com/shared/IWHwTqTbd
I had to try but not working maybe l do something wrong.
Can you modify my project to working on reopen function.
Please help me.
Thank you very much. -
https://fxdreema.com/shared/vdsS1O2Ec
Something like this, but not this. The problem here is that new pending orders are created every day, and at that time there can be an old trade still running. Then, because I used "No trade/order exists", a new pending order is created when everything is closed (no orders, no trades) and at these moments the last closed trade is... who knows how old is it. Some trades will be missed.
https://fxdreema.com/shared/0FhOX0hN
This is similar, but not the same. Note that "once per trade" have memory that is cleared when the EA is reloaded.
At least you can get some idea
