Here I have a code and have a problem with stdev()the parameter length requires integer value which is stored in variable "bar". How can I make it read the value from a variable.
//@version=4
study("My",overlay=true)
numbars=1
t= time('D')
if t == t[1]
numbars :=nz(numbars[1]) + 1
else
numbars :=1
bar=numbars
z=stdev(close,"bar")
a=vwap + (3*z)
b=vwap-(3*z)
plot(vwap)
plot(a)
plot(b)