Why is this EA not taking trades when it is supposed to
-
Order number 8 should open when order number 5 opens in the backtest result above because they have the same open price and were placed at the same time. It does not open and gets deleted .

This is the same backtest when the EA takes the trades as it should . -
@od this happens because you have choose "create OCO order" (One Cancels Other)

when one buy order is triggered, a sells pending order is deleted, and viceversa
-
@ambrogio Yes that is how it should work. The buy stop order (5) and sell limit order (8) have the same open price at the same time but the sell limit order (8) does not open. Some times the OCO works sometimes it does not. Orders like order number (7) above should have been deleted if only order (8) could have opened. Choosing the OCO order is the whole strategy mechanism but it works flawlessly sometimes only. What could be making it skip some trades?
-
@od i see that you are using "mid price" for pending orders only now. Don't do it. Always use Ask price for buys orders and Bid price for sells orders. You will see that all is fine. The spread will be calculated by the platform (in my case spread = 1.5 pips). Look at this screenshot, orders #13 #14 #15 #16

-
@ambrogio I was using the mid price since each of the two pending orders can open a buy or sell. After changing as said it now takes the trades even if with spreads but sometimes the other order is not cancelled.

For example the orders highlighted above should both be deleted when the sell stop and buy limit orders (86&87) open trades. But order 85 is not deleted and it ends up opening a trade when it should not.https://fxdreema.com/shared/L2dT0Ck4 -
@ambrogio Again if you could, is there a way you can show me how to close partially these trades after 20 pips while maintaining the stop loss level of the parent trade.
-
@od said in Why is this EA not taking trades when it is supposed to:
@ambrogio I was using the mid price since each of the two pending orders can open a buy or sell. After changing as said it now takes the trades even if with spreads but sometimes the other order is not cancelled.

For example the orders highlighted above should both be deleted when the sell stop and buy limit orders (86&87) open trades. But order 85 is not deleted and it ends up opening a trade when it should not.https://fxdreema.com/shared/L2dT0Ck4I repeat myself: DON'T use the mid price. Please, make as i suggested you, try it and check.
-
@ambrogio Am not using mid price it is changed
-
@od in the buys block put Ask price

-
@ambrogiohttps I have done that still the issue of not deleting some trades is still there. I don't see the bid and ask price as the issue since the two pending order blocks should be opening opposite trades at the same price.https://fxdreema.com/shared/aJc6IRtid

This is from a backtest after changing all open prices to ask. Still as you can see order number 45 wasn't deleted. -
@od how much is the spread?
-
@ambrogio Just using the current spreads not fixed
-
@ambrogio Do you think there may be a bug in the OCO
-
@od i've tested your last project, no problem for me

-
@od can u test m project and help? i have complie error from custom indicator
-
@ambrogio It is just a screenshot , it works well up to a point then stops. Do you have a complete results which I can compare .
-
@youngtreptrader can u create another thread ? someone who can will from there..
-
@od said in Why is this EA not taking trades when it is supposed to:
@ambrogio It is just a screenshot , it works well up to a point then stops. Do you have a complete results which I can compare .
Maybe you have some problems with the platform or historical data.....i don't know.
-
@ambrogio Did you use every tick to backtest?
-
@ambrogio Plus I've tried making the trades close partially with no success . Kindly if you can try it out please do as you say maybe it is my platform or historical with issues I don't know.