OPEN-SOURCE SCRIPT
FRX_FORTUNE - EMA 9/15 Crossover Alert

//version=5
indicator("FRX_FORTUNE - EMA 9/15 Crossover Alert", overlay=true)
// === INPUTS ===
fastEmaLength = input.int(9, title="Fast EMA (9)")
slowEmaLength = input.int(15, title="Slow EMA (15)")
showArrows = input.bool(true, title="Show Buy/Sell Arrows")
enableAlerts = input.bool(true, title="Enable Alerts")
// === CALCULATIONS ===
fastEma = ta.ema(close, fastEmaLength)
slowEma = ta.ema(close, slowEmaLength)
bullishCross = ta.crossover(fastEma, slowEma)
bearishCross = ta.crossunder(fastEma, slowEma)
// === PLOT EMA ===
plot(fastEma, title="EMA 9", color=color.orange)
plot(slowEma, title="EMA 15", color=color.blue)
// === DRAW ARROWS ===
plotshape(bullishCross and showArrows, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY", size=size.small)
plotshape(bearishCross and showArrows, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL", size=size.small)
// === ALERTS ===
alertcondition(bullishCross, title="Buy Alert", message="BUY: EMA 9 crossed above EMA 15")
alertcondition(bearishCross, title="Sell Alert", message="SELL: EMA 9 crossed below EMA 15")
indicator("FRX_FORTUNE - EMA 9/15 Crossover Alert", overlay=true)
// === INPUTS ===
fastEmaLength = input.int(9, title="Fast EMA (9)")
slowEmaLength = input.int(15, title="Slow EMA (15)")
showArrows = input.bool(true, title="Show Buy/Sell Arrows")
enableAlerts = input.bool(true, title="Enable Alerts")
// === CALCULATIONS ===
fastEma = ta.ema(close, fastEmaLength)
slowEma = ta.ema(close, slowEmaLength)
bullishCross = ta.crossover(fastEma, slowEma)
bearishCross = ta.crossunder(fastEma, slowEma)
// === PLOT EMA ===
plot(fastEma, title="EMA 9", color=color.orange)
plot(slowEma, title="EMA 15", color=color.blue)
// === DRAW ARROWS ===
plotshape(bullishCross and showArrows, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY", size=size.small)
plotshape(bearishCross and showArrows, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL", size=size.small)
// === ALERTS ===
alertcondition(bullishCross, title="Buy Alert", message="BUY: EMA 9 crossed above EMA 15")
alertcondition(bearishCross, title="Sell Alert", message="SELL: EMA 9 crossed below EMA 15")
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.