I need to create counter like that:
var count = 0
if a == b
count := count + 1
But it doesn’t work! help please.
I know that it is stupid question but i really dont know what to do
>Solution :
It works (and exactly like you have written)
Below is a simple test for the same where i am incrementing the count wherever close==open, and also displaying the count
//@version=5
indicator('Counter Test By Rohit',overlay=true)
var count = 0
if close == open
count := count + 1
label.new(bar_index,high,str.tostring(count),color=color.white)
