@javadTT
Try this, it's a simple solution that you can use to test your strategy at least once. The time filters must be arranged correctly. And since the candle to be checked is in the past day, there must also be 2. Of course, the time can be converted much more comfortably, but with this method you can easily make improvements yourself. In the "on Init" function the candle is calculated, of course this only works if there are no trading hours, so be careful here. You can set different time frames, which will be converted automatically. At 30 minutes you have 44 candles and at 1 hour you have 22.
https://fxdreema.com/shared/F7DrrzpFd