OPEN-SOURCE SCRIPT

Ultimate Customizable EMA/SMA

Updated
I know, not another EMA indicator, but I promise, I will make it worth your while!

About this indicator:

This is an EMA indicator, plain and simple. But its ultimate! And its ultimate in the sense that I have made it vastly customizable.
I made this indicator as a boring, single line indicator that would allow me to toggle to whichever EMA / SMA I wanted on whatever timeframe I wanted, because with the currently available EMAs and SMAs (and there are tons of them), I could never seem to get one with the precise settings I wanted.

Then I realized, if I struggled with this, chances are other people may be struggling with this. And also chances are not everyone is great with coding things quickly and it may be out of reach for those to code something specific to their individual needs and desires.

So this indicator is meant for those who, like me, may have very specific tastes for their EMA indicator and want to be able to tailor it right down to a T of what they want, but maybe don't have the skills to code things specifically the way they would like it.

So what can I do with it?

Well, you can do really whatever you want. I have made absolutely everything possible customizable, right down to the size of the plotted line (you can adjust the width of the line to make it more or less visible). But let me give you a list of the functions permitted for this indicator:

1. Toggle between an EMA or SMA: The indicator will default to show the EMA. However, you can toggle between an EMA or SMA, depending on your preference.

2. Add 2 EMA's or SMAs: The indicator permits up to 2 EMA's to be added. Both of which can be either EMA or SMA and operate independently (you can have one as EMA and the other as SMA, both as SMA or whatever combination thereof).

3. Specify your timeframes: Each EMA/SMA can have an individual timeframe. If you want to plot 2, 200 EMA's on your chart, 1 on the 5 minute chart and the other on the 1 Day chart, you can do it! The indicator will permit you to individually select which timeframe you want for both of the available EMAs/SMAs. They can both be on separate timeframes.

4. Specify your sources: In addition to both being able to be on separate timeframes, both can also be on separate sources. You can have the 200 EMA of the close price as well as the 200 EMA of the high or low price. The indicator will permit you to specify your preferred sources.

5. Plot Standard Deviation bands: You can plot the standard deviation bands of the primary EMA/SMA (this is only available on the primary EMA/SMA and not both). You can also specify the length of the standard deviation bands that can operate independently of the primary EMA/SMA. So if you have the 50 EMA but want the 200 standard deviation bands, you can do so and specify this in the data inputs.

6. Customize your alerts: The indicator provides 6 pre-programmed condition alerts that are applied to both the primary, secondary and both EMAs. This way, you can customize various alerts based on various conditions you want to look for.

7. Plot crossover / crossunder arrows: The indicator will allow you to request it to plot triangles to signal crossovers and crossunders. This can be toggled on and off based on your visual preference.

8. Provides demographic information: The EMA will provide basic demographic information about the stock's behaviour around the EMA/SMA. This is displayed in a table at the top right of the chart. It will tell you the number of touches a stock has with its various EMA/SMAs, how many closes it has had above or below the EMA/SMA (for example, a bullish ticker should have more closes above an EMA than below it and inverse for bearish), how many times the close price has crossed over or crossed under the two EMA/SMAs and how many time the EMA/SMAs have crossed over and crossed under each other. This all gives an idea of the relative strength and sentiment of a stock in a quantitative way. The length of the lookback period is customizable individually for each EMA/SMA. If you want to look back 100, 200, 500 or just 75 candles, you can specify. You can also toggle on and off each or both tables as you desire.


Final thoughts:

The indicator was meant to tailor to my general need to toggle between very specific EMAs and SMAs to gauge averages. I generally will look at various EMAs and SMAs to calculate various things and I never specifically rely on a single EMA and SMA. Its annoying having to switch between multiple indicators and I always ended up opening pinescript and coding in what exactly I wanted to look at. This was meant to stop me from having to constantly code something specifically each time I wanted very specific information and I felt like I should share it with the community, as if I find it helpful and useful, I hope others will, too!


Hopefully you find it helpful and useful and as always leave your suggestions below!
Release Notes
Updated the EMA / SMA toggle to be a bit more user friendly.
Moving Averages

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 publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


For real-time updates and premium indicators, consider joining my group at: patreon.com/steversteves
Also on:

Disclaimer