OPEN-SOURCE SCRIPT

Perfect Triple EMA Cross (15min Only)

109
//version=5
indicator("Perfect Triple EMA Cross (15min Only)", overlay=true)

// ==== Inputs ====
ema20 = ta.ema(close, 20)
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)

// ==== Timeframe Check ====
is15min = (timeframe.period == "15")

// ==== Conditions ====
buyCond = is15min and ta.crossover(ema20, ema50) and ema20 > ema50 and ema50 > ema200
sellCond = is15min and ta.crossunder(ema20, ema50) and ema20 < ema50 and ema50 < ema200

// ==== Plots ====
plot(ema20, title="EMA 20", color=color.orange, linewidth=1)
plot(ema50, title="EMA 50", color=color.blue, linewidth=1)
plot(ema200, title="EMA 200", color=color.red, linewidth=2)

plotshape(buyCond, title="BUY", location=location.belowbar, style=shape.labelup, color=color.green, size=size.normal, text="BUY")
plotshape(sellCond, title="SELL", location=location.abovebar, style=shape.labeldown, color=color.red, size=size.normal, text="SELL")

// ==== Alerts ====
alertcondition(buyCond, title="BUY Signal", message="Triple EMA BUY Signal (15min)")
alertcondition(sellCond, title="SELL Signal", message="Triple EMA SELL Signal (15min)")

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.