i want to make a counter that can count how many 1 minuttes candles been printet i tradingview since yesterday 23:00. I have tried to get help from ChatGPT, but NO luck ?
I hope someone here can help me.
Thanks.
Br mike-kaast
i have tryied the flowwing:
//@version=5
indicator("Candles Since 23:00 Previous Day", overlay=true)
// Deklarer variabel med type
var int candlesSince23 = na
// Beregn antallet af 1-minutslys siden kl. 23:00 i går
if (hour == 0 and minute == 0)
candlesSince23 := 0
else if (hour == 0)
candlesSince23 := bar_index - 1
// Tegn en tæller på indikatorens område
var label counter_label = label.new(x=na, y=na, text="", xloc=xloc.bar_index, yloc=yloc.abovebar, style=label.style_label_right, color=color.blue, textcolor=color.white)
// Opdater tælleren
label.set_xy(counter_label, bar_index, high)
label.set_text(counter_label, "Candles since 23:00 Previous Day: " + str.tostring(candlesSince23))
BUT this dosent work, it prints af wrong number of 13344 ???
New contributor
mike-kaast is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.