OPEN-SOURCE SCRIPT

My script

42
/version=5
indicator("50 EMA - Green Up / Red Down", overlay=true)

// Calculate the 50 EMA
ema50 = ta.ema(close, 50)

// Determine if the EMA is rising or falling
color_ema = ema50 > ema50[1] ? color.green : color.red

// Plot the 50 EMA with dynamic color
plot(ema50, title="50 EMA", color=color_ema, linewidth=2)

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。