Wjadevries

WJA double EMA

Simple indicator with two exponential moving averages and crossover alert.
Why didn't this exist already?
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

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.

Want to use this script on a chart?
//@version=2
study("WJA double EMA", overlay=true)

slowperiod = input(50, title="Slow EMA period", minval=1, type=integer)
fastperiod = input(20, title="Fast EMA period", minval=1, type=integer)

slowema = ema(close, slowperiod)
fastema = ema(close, fastperiod)

plot(slowema, color=blue, linewidth=2, title="Slow EMA")
plot(fastema, color=fuchsia, linewidth=2, title="Fast EMA")

plot(cross(slowema,fastema) ? fastema : na, style=circles, linewidth=4, color=slowema>fastema ? red : green)

alertcondition(cross(slowema,fastema), title="EMA cross", message="EMA cross")