Remove pending hedge orders
-
I want to make a very simple EA that removes pending orders that will hedge an already open order if they kick in.
If I have an EA placing a pending BUY order on the EURUSD and I already haven an open SULL trade on the EURUSD I would like to delete that pending order.
I guess it's very simple to make, but I'm not sure which way to start. So any ideas are welcome.I thought about starting with a block checking if there are any pending buy orders in any market.
Then make a block next to that which is looking for any pending sell orders in any market.
The next block after the buy check block have to look for open orders in that specific market and then I got stuck.Or should I start with a block looking for open orders and check wheter they are BUY or SELL and then look for pending orders?
I just can't come up with a logical flow how to make it, but it should be easy... at least it would, if I just know which blocks to use here. Any ideas?
-
It depends. Will there be more than one pending order for every open order right now?
-
Well, the might be a pending order on the EURUSD or the GBPUSD or other pairs. And there might be an open order on that pair that I took manually maybe. So I never know what it will be like all the time. So I need it to check the pending orders and if they are a BUY or SELL and then look if there are any other open trades in the opposite direction.
-
So, you mean that pending orders are NOT on the same chart. Right? Is there an equal amount of open orders and pending orders?
-
Well, that's why I want it to look for all the open trades. If an EA is placing a pending order on USDCHF, EURUSD, AUDUSD or whatever pair, then it should look at all the open trades in my account and see if there are any open trades running in the opposite direction as the pending order and if so, then remove the pending order.
This way I will not have any hedged open orders running in my account.It sounds so easy, but I just don't get it where to attack this strategy. In what end to start and then which blocks to use in the right way. And of, course... is it even possible?
But in my head it sounds like an easy thing to check. -
Then I'm afraid that goes beyond my possibilities. My knowledge of Fxdreema is not good enough to do something like that, I'm very sorry. Probably there will be someone who will be able to help you.