If you call the indicators with an empty timeframe (= 0) they will calculate values accordiing to the timeframe that is set for the chart resp. set for the backtest. As your strategy is based on D1 it is better to call the indicators with a fixed timeframe PERIOD_D1. You could make this an input value to your EA.
input ENUM_TIMEFRAMES TF=PERIOD_D1;
thank you so much @lippmaje.