The script below always gives back the color red for my label colors. What am I doing wrong here? Any feedback appreciated (pretty new to pine).
study("Info Labels", overlay = true)
// Variables and Conditions
ema8 = ema(close, 8)
ema13 = ema(close, 13)
ema21 = ema(close, 21)
ema34 = ema(close, 34)
ema34h = ema(high, 34)
sc1 = ema8 >= ema13
sc2 = ema13 > ema21
sc3 = ema21 > ema34
sc4 = close > ema34h
colorlabel1 = sc1 ? color.green : color.red
colorlabel2 = sc4 ? color.green : color.red
var label1 = label.new(bar_index, high, text = "8:13:21", style = label.style_label_lower_right, color =
colorlabel1, size = size.small)
var label2 = label.new(bar_index, low, text = "Wave ", style = label.style_label_lower_left, color = colorlabel2, size = size.small)
label.set_xy(label1, bar_index[1], high[1] + atr(21))
label.set_xy(label2, bar_index[1], high[1] + atr(21))