OPEN-SOURCE SCRIPT

9 EMA & 15 EMA Crossover Arrows

55
//version=5
indicator("9 EMA & 15 EMA Crossover Arrows", overlay=true)

// EMA calculations
ema9 = ta.ema(close, 9)
ema15 = ta.ema(close, 15)

// Detect crossovers (on previous candle)
bullishCross = ta.crossover(ema9[1], ema15[1])
bearishCross = ta.crossunder(ema9[1], ema15[1])

// Plot arrows on previous candle
plotshape(bullishCross, title="Bullish Cross", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.small, offset=-1)
plotshape(bearishCross, title="Bearish Cross", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.small, offset=-1)

// Plot EMAs (optional for visual)
plot(ema9, color=color.green, title="9 EMA")
plot(ema15, color=color.orange, title="15 EMA")

免責聲明

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