mart
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: March 12th, 2023

why I have this error...

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

Steve Burman
Moderator
Moderator
Posts: 109
Joined: January 13th, 2023

Re: why I have this error...

Mart,

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

Return to “Pine Script Q&A”