Moving Average Envelope

The Moving Average Envelope adds a parallel line above and below a moving average using a given percentage of the price. These lines can be useful for identifying short term price fluctuations. The user may change input (close), method (EMA), period, shift and deviation values. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Moving Average Envelope

No trading signals are calculated for this indicator.

How To Access in MotiveWave

Go to the top menu, choose Study>Overlays>Moving Average Envelope

or go to the top menu, choose Add Study, start typing in this study name until you see it appear in the list, click on the study name, click OK.

Important Disclaimer: The information provided on this page is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security. Please see our Risk Disclosure and Performance Disclaimer Statement.

Calculation

//input = price, user defined, default is close
//method = moving average (ma), user defined, default is EMA
//period = user defined, default is 20
//shift = user defined, default is 0
//topDev = percent, user defined, default is 2.5
//bottomDev = percent, user defined, default is 2.5
//LT = less than, LOE = less or equal

```latest = size()-1;
end = latest;
if (shift LT 0) end -= shift;
topDev = topDev/100;
bottomDev = bottomDev/100;
// Calculate top and middle and bottom lines
for(int i = period; i LOE end; i++)
ma = ma(method, i, period, input);
Plot1: top[i+shift] = ma + topDev * ma;
Plot2: middle[i+shift] =  ma;
Plot3: bottom[i+shift] = ma - bottomDev * ma;
endFor
```