Envelopes

Envelopes are formed with two moving averages, one shifted upward and the other shifted downward. Envelopes define the upper and lower margins of a price range. They are calculated as follows: Upper Band = SMA(CLOSE, N) * [1 + DEVIATION] Lower Band = SMA(CLOSE,N) * [1 - DEVIATION]. The user may change input (close), method (SMA), period, shift and deviation values. This indicator’s definition is further expressed in the condensed code given in the calculation below.

Envelopes

How To Trade Using Envelopes

No trading signals are calculated for this indicator.

How To Access in MotiveWave

Go to the top menu, choose Study>Overlays>Envelopes

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 SMA
//period = user defined, default is 14
//shift = user defined, default is 0
//deviation = user defined, default is 1
//LT = less than, LOE = less or equal

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