I am trying to make double loop work in Pine Editor code, inside a expression if. I would appreciate if someone could help.
When compiling it seems that code only recognize second loop for, making invalid the first one.
I tried a bunch of differents things but any of them worked.
Thanks in advance.
if barstate.isfirst
for i = 0 to 499 by 1
array.push(ln, line.new(na,na,na,na))
for i = 0 to length/k-1
array.push(upper,line.new(na,na,na,na))
array.push(lower,line.new(na,na,na,na))