enter image description hereTrying to box for every 2:00 PM candle candle generated in trading view between any 2 dates and extend it left & right. Have written a code but it draws for last 2 days only not for all the specified dates and extended it completely left & right of chart
indicator("14:00 PM Candles", overlay=true)
leftExtension = input(500, "Left Extension")
rightExtension = input(500, "Right Extension")
var float high_225 = na
var float low_225 = na
startDate = timestamp(2023, 01, 01, 00, 00)
endDate = timestamp(2023, 06, 30, 23, 59)
h = input.int(14, "Hour", minval=0, maxval=59)
m = input.int(20, "Hour", minval=0, maxval=59)
is225Candle = (hour == h) and (minute == m) and time >= startDate and time <= endDate
//is225Candle = ta.time(hour, minute) == ta.time(9, 30) and time >= startDate and time <= endDate
if is225Candle
high_225 := high
low_225 := low
plotshape(is225Candle, title="14:00 PM Candle", color=color.green, style=shape.labelup, text="14:00", location=location.belowbar, size=size.small)
box.new(left=bar_index - leftExtension, top=high_225, right=bar_index + rightExtension, bottom=low_225, border_color=color.rgb(215, 165, 217), border_width=1, bgcolor=color.rgb(209, 156, 198))
Was expecting something as per attached image the green ones are missing, my code is just taking back 2 days only.