OPEN-SOURCE SCRIPT

Mean sma Standard Deviation Bands

Here’s a summary of how the script works:

Input Parameters:

emaLength: The length of the EMA (default is 90).
stdDevMultiplier: A multiplier for the standard deviation (default is 1.0).
EMA Calculation:

The script calculates the EMA based on the close price of the chart and the specified emaLength.
Standard Deviation Calculation:

It calculates the standard deviation of the closing price over the same emaLength.
Upper and Lower Bands:

Upper and lower bands are generated by adding or subtracting multiples of the standard deviation from the EMA.
The script defines 8 upper bands and 3 lower bands, each one a step away from the EMA.
Plotting:

The EMA is plotted in white.
The upper bands are plotted in red, and the lower bands in green, with different intensities for each band.
Bands and ChannelsBreadth IndicatorsCycles

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?

Disclaimer