Buy Now @ Candle Close (or close to it)
-
I'm trying to figure out how set buy orders at the candle close. Right now, when I do Buy Now it puts the price well above the candle and then the trade immediately closes on the next candle when backtesting.

link: https://fxdreema.com/shared/Eo40gRfTb
Any tips for getting my orders to execute to when the candle closes or close to candle close?
Thank you!
-
Look at the spread... It is 15 pips wide. Your EA is buying on close. Find a broker or pair with a 1 pip spread and test.
-
Ah, that makes a lot of sense. I'll keep an eye out for that.
After doing some digging I was able to fix it, I think, by messing around with some of the pending buy order settings. And with doing a price offset.

When I trade, I normally just put in market orders. Usually, these are very close to the candle close so I thinking I need to learn more about how an EA makes buy orders lol.
I was looking at the example on this post here
https://fxdreema.com/forum/topic/4642/buy-trades-not-being-opened
https://fxdreema.com/shared/fDvrGsaKbSwitching up the once per bar + buy now + buy pending order seemed to fix it. Now when I run the test it's buying at the candle close