In light of this post I'd like to ask why the script hereunder works for [a,b]
but doesn't work for [c,d]
.
Cannot find any documentation that explains why this doesn't work.
This example is only for 2 return values, but in reality I'm going to create a function with 6 or more variables to be returned in one go.
I'm trying to avoid having to enter 6 different lines, because I'll be entering this data every trading day (the function will be date-depentent and I already have code for that).
So I'd like to only have to enter 1 line per day to keep the source code clear and maintainable.
//@version=4
study("Functions test")
var int c = na
var int d = na
f(x) => [x,x+5]
[a,b] = f(20)
[c,d] := f(30)
plot(a)
plot(b)
plot(c)
plot(d)