Assign a sell pending order to a particular buy trade
-
I have a strategy. At the end of each candle, draw a Fibonacci retracement from the high to the low of the (now previous) candle. Set a Buy pending order for the high of the previous candle, and a Sell pending order at the low of the previous candle.
If the Buy pending order triggers, immediately set a Sell pending order (for the current Buy trade). I was able to generate the initial pending orders, but the secondary Sell pending order (that is if the Buy trade triggers) is not being activated. What am I getting wrong? https://fxdreema.com/shared/dGLPUEq2c
-
Split things into separate trees, you likely need a if no trade/order block, use on trade tab so if an order becomes a trade an order is placed.
-
@jstap Thank you for kindly replying to my enquiry. I have applied your recommendations and tweaked several, but I am still not getting the results I intended.
I want my EA, on launch, to draw a Fibo retracement from the high of the previous candle to the low of the same candle. The Fib has the following levels: 0,1,-0.5,1.5, 0.236, 0.764, 1.25, -0.25, and 0.5.
The EA should open a Buy pending order at the High (Fib level 1 (1) of the previous candle (SL at Fib level 5 (0.764), TP at Fib level 6 (1.25) and a Sell pending order at the low of the same candle (fib level 0, SL level 4 (0.236), TP level 7 (-0.25).If the Buy trade triggers first, the EA should delete the Sell pending order, and vice versa. On a Buy trade, the EA should immediately open a Sell pending order with double lot size at the SL of the buy trade (Fib level 5 (0.764), SL at level 1, TP at fib level 8 (0.5). Similarly, if the sell trade first triggers, the EA should open in double lots a Buy pending order at level 4 (0.236), SL at level 0, TP at level 8 (0.5).
If any of the recent pending orders is triggered, a new pending order is created in double lots, similar to the original pending orders (Buy or Sell).
I have tried my best, but I don't know what I'm doing wrong: https://fxdreema.com/shared/qcN3jQZN. I need your help again, please.
-
What I would do is create the EA the EA with only a couple of trees, and then test. This way is easier to assess what's happening.
-
Thank you for your reply. Did you look at what I"ve done so far (the link)? I have succeeded in having the trades executed, but to have the pending orders deleted after a successful trade (TP won) is closed is still a problem. You may wish to be more specific in your help, Sir. Thank you for your undeserved care.
-
No because you want people to assess many blocks, so what is happening is a lot of work to see.
-
Ok, I understand.
-
My question is How do I tag a particular pending order to a specific previous trade so that when that previous trade closes in a loss, my pending order will trigger? In what I've done so far, some pending orders trigger while others do not. In the link shared here https://fxdreema.com/shared/918rU9Fgd, blocks 15 and 24 do trigger fine but blocks 32 and 36 do not trigger. What can I do to correct this?
-
You will need a custom code array doing that if there are several open positions and/or programmed pending orders at the same time. I'm afraid no block in fxDreema can do that.