Page 1 of 1

why I have this error...

Posted: Sun Mar 12, 2023 6:00 am
by mart
Mismatched input '|PE|' expecting ')'

//@version=5
bcolor = if (if val > 0 and val > val[1]
color.lime
else
color.green
if val < 0 and val > val[1])
color.red
else
color.maroon

Re: why I have this error...

Posted: Mon Mar 13, 2023 10:18 pm
by Steve Burman
Mart,

You're missing the closing brackets on the line
bcolor = if (if val > 0 and val > val[1]