I’m facing issue to define the time of calculation in the code. I am implementing a code that calculates the highest high and lowest low of a specific period (form 01:00 am to 16:30 pm) startime = 010000 endtime = 163000 // calculate highest high and lowest low of the last 15 hours , start calculation at 4:30 pm if time = endtime then HighestHigh = highest[15](Close) LowestLow = lowest[15](close) ENDIF The code is working good without the IF condition, but when I add IF condition to specify the time of calculation it is not working. Your support and feedback is highly appreciated