Why my EA always opens 2 pending orders? Please take a look at my ea
-
Hello guys this is my EA
https://fxdreema.com/shared/IFidHIiqeI have only one condition after which I want the EA to open pending orders 5 pips apart from each other.
Also, OCO is actvie.But my ea always opens 2 buy pending and 2 sell pending orders. As shown in the picture. I feel there is something wrong with the pending order block.

-
@ankitrader Is this the whole project or just a part of it? The logix is correct. One one buy and on sell should be programmed?
-
Yes I want to only go ahead with the idea if things work out now. Or there is no point in trying.
I did not understand your question sell should be programed?
I want the EA to:
open one buy order at 2.5 offset and sell at 2.5 offset
but the EA always makes 2 buy and 2 sell orders -
I feel either there is a problem with my MT4 setting or the pending order block.
please try on your MT4 and let me know. @l-andorrà -
@ankitrader Sorry for my text corrector.
What I mean is that your logic is correct. There should be one trade only and not for a buy and a sell. Probably the file is corrupt. I recommend to reabuild the whole project in a new file. -
@l-andorrà I have tried few times it does not work. I really feel their is an issue with the buy sell pending blocks.
You can try it too. -
@ankitrader OCO order literally means 2 pending orders.

-
@roar please go through the problem properly.
-
@ankitrader OCO duplicates your 2 orders. 2*2=4.
You dont need OCO here, just disable it
-

you the best! @roarBut now the question lies, how can I delete the order when one of them is triggered?
Thanks buddy! -
@ankitrader for example,
if trade -> delete pending orders
or
pending orders count != 2 -> delete pending orders -
@roar said in Why my EA always opens 2 pending orders? Please take a look at my ea:
@ankitrader OCO duplicates your 2 orders. 2*2=4.
You dont need OCO here, just disable it
I didn't know that!
Impressive... -
@roar thanks mate