wwma(l,p) =>
wwma = (nz(wwma[1]) * (l - 1) + p) / l
I'm going to convert it to v4, but I got a error, Undeclared identifier 'wwma'. Then changed to:
wwma = 0.
wwma := (nz(wwma[1]) * (l - 1) + p) / l
Still an error:
Undeclared identifier 'l';
Undeclared identifier 'p';
'wwma' is not a function.
Any help would be appreciated.
Create a function f_wwma
with l
and p
arguments as shown below:
f_wwma(l, p) =>
wwma = 0.
wwma := (nz(wwma[1]) * (l - 1) + p) / l
Then you can call that function with defined length (l
) and source (p
) arguments:
wwma = f_wwma(50, close)
plot(wwma)