In pine script I have a funtion that returns a tuple:
calcSomething(val1, val2) =>
...
[val3, val4]
And I'm calling the function from a loop where the val1 and val2 change:
while i < 5
[val5, val6] = calcSomething(val1, val2)
val1 += 1
val2 += 1
i += 1
Unfortunately the values from val5 and val6 remain the same every time the loop runs.
I tried to change "="
[val5, val6] = calcSomething(val1, val2)
to ":="
[val5, val6] := calcSomething(val1, val2)
But it returns a Syntax error at input ':='.
How can the tuple change values from inside a loop.