I m coding in Pine Script and I am trying to increase the variable "count" by 1 when a logical test is confirmed "close >= open", so I try to use the following code:
var count = 0
if close >= open
count := count + 1
plot(count)
When I try to save it I get the following error msg:
"no viable alternative at input 'count'"
If I try to remove the "var" in front of the count, always 0 is plotted in the chart.
Any ideas where the problem is? Thx