Hi guys can someone help me to understand what is wrong with this code ? I keep receiving the msg syntax error at input barcolor
Here's the code
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
//@version=5
indicator(title="bar color", overlay=true)
fastMA = ta.sma(close,8)
slowMA = ta.sma(close,200)
plot(fastMA, color=color.blue)
plot(slowMA, color=color.red)
if fastMA > slowMA
barcolor(close > close[10] ? color.yellow : color.white)
if fastMA < slowMA
barcolor(close < close [10] ? color.green : color.black)