candle count
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Shauryam_or

//@version=5
indicator(title='candle count', overlay=true,max_labels_count=500)

//backtest engine
start = input.time(timestamp('2022-12-16'), title='Start calculations',group='Backtest Period')
end=input.time(timestamp('2025-03-01'), title='End calculations',group='Backtest Period')

time_cond = time >= start and time<=end


text_color=input.color(color.blue,title="Text Color Input")

numBars = 1


if time_cond
    numBars := nz(numBars[1]) + 1
    numBars
else
    numBars := 0
    numBars

label.new(bar_index, high, str.tostring(numBars), textcolor=text_color, style=label.style_none)
