What code to use to know if we want to print numbers on candle, such as if i want to plot 30 on 30'th candle, 7 on 7'th candle using index divisible in every timeframe.
novice in pine world, help would appriciate.
before i am using v_line with bar_index 30, but this will help clean up chart. here is what i have done.
//@version=5 indicator(title='candle count', overlay=true,max_labels_count=500)
text_color=input.color(color.blue,title="Text Color Input")
numBars = 0
t = time('D')
if t == t[1] numBars := nz(numBars[1]) + 1 numBars else numBars := 1 numBars
label.new(bar_index [30], high, str.tostring(numBars), textcolor=text_color, style=label.style_none)
but this will plot on all the candles i want it on only pirticular number candle.
