OPEN-SOURCE SCRIPT
9 EMA & 150 EMA Crossover Arrows

//version=5
indicator("9 EMA & 150 EMA Crossover Arrows", overlay=true)
// EMA definitions
ema9 = ta.ema(close, 9)
ema150 = ta.ema(close, 150)
// Candle conditions
isBullish = close > open
isBearish = close < open
// Crossover logic
bullishCross = ta.crossover(ema9, ema150)
bearishCross = ta.crossunder(ema9, ema150)
// Entry conditions
bullishSignal = bullishCross and isBullish and close >= ema9
bearishSignal = bearishCross and isBearish and close <= ema9
// Plot arrows
plotshape(bullishSignal, title="Bullish Entry", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.small)
plotshape(bearishSignal, title="Bearish Entry", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.small)
// Plot EMAs
plot(ema9, color=color.orange, title="EMA 9")
plot(ema150, color=color.blue, title="EMA 150")
indicator("9 EMA & 150 EMA Crossover Arrows", overlay=true)
// EMA definitions
ema9 = ta.ema(close, 9)
ema150 = ta.ema(close, 150)
// Candle conditions
isBullish = close > open
isBearish = close < open
// Crossover logic
bullishCross = ta.crossover(ema9, ema150)
bearishCross = ta.crossunder(ema9, ema150)
// Entry conditions
bullishSignal = bullishCross and isBullish and close >= ema9
bearishSignal = bearishCross and isBearish and close <= ema9
// Plot arrows
plotshape(bullishSignal, title="Bullish Entry", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.small)
plotshape(bearishSignal, title="Bearish Entry", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.small)
// Plot EMAs
plot(ema9, color=color.orange, title="EMA 9")
plot(ema150, color=color.blue, title="EMA 150")
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.