Close all current trades and orders at next daily candle open
-
Hello,
I'm trying to get my EA to close all live trades and orders at the next daily candle open. Currently i'm using the time filter block to specify a GMT time to estimate what time the next daily candle will open. However, due to daylight saving time changes, this causes some trades/orders to close too early or late depending on the month we are in.
So is there an easy way to just specify for my trades/orders to close at the next daily candle open? This way, all of the daylight saving time changes are taken care of. Any help or direction would be much appreciated. Thanks, KP.
This is my current setup:

-
backtests dont account for time outside of server time.
-
@krunal20 This will close all open trades at the open price of every daily candle, no matter what time is it:

-
@TipsyWisdom Thanks for the response! However, the time filter works in backtesting when i set it to 19:58 in some cases but I think you're right, I have seen cases where it hasn't worked as expected when I change the time to be something else.
@l-andorrà Thanks for that. I have tried that before but can't seem to get it to work. It doesn't close any trades at all, just waits until they hit the s/l or t/p.
Just having a look at the chart behaviour and what I actually want is for the trades to be closed at the close of the current daily candle rather than the open of the next (even in cases where the trade has just been executed a minute before the close).
Appreciate the replies guys. Please let me know if i'm not being clear on what i'm trying to achieve.
Cheers, KP.
