Introduction : 

Moving Average Envelope is formed by plotting a certain fixed or percentage-based range above and below a moving average with percentage-based envelopes being most commonly used. It would look similar to a Bollinger Band. Envelops can be applied to any of the moving averages. Whipsaws can be reduced by applying an envelope and hence some of the false signals can be eliminated.

Moving Average Envelope
Fig. 1. – Moving Average Envelope

The image above shows a moving average envelope. The middle (orange) line is SMA 200. The blue lines above and below the average form the envelope. It looks similar to Bollinger bands. The consents are also very similar. However, the bands in Bollinger bands are formed by calculating the standard deviation. The next paragraph shows the calculation of the indicator. Later in the article, we will also see how we can use the Streak platform to incorporate this indicator in our trading.

Calculating Moving Average Envelop :

The first step in the calculation is to choose a moving average of our choice. As an example, we will choose SMA 200. Once we select the moving average, the next step is to choose the percentage for the envelope. For our example, let’s consider 2%.

The following is the calculation for the bands : 

Upper Band: 200 SMA + 2% of 200 SMA = 200 SMA + 200 SMA x 0.02

Lower Band: 200 SMA – 2% of 200 SMA = 200 SMA – 200 SMA x 0.02

Overbought and Oversold Levels :

Overbought/Oversold Levels
Fig. 2 – Overbought/Oversold Levels

Identifying and trading overbought and oversold levels can be tricky. Stocks can remain in the overbought/oversold region and the trend can keep extending. This happens whenever the trend is very strong. We can also observe this in RSI. Whenever the market is trending strongly upwards, the RSI can remain in the overbought zone i.e above 70 for a very long time before the stock starts correcting.


Hence it becomes important to trade overbought and oversold conditions only when the market is consolidating. We can also use Moving Average Envelopes to identity overbought/oversold as follows : 

Overbought: Price is higher than upper envelope

Oversold: Price is lower than lower envelope 

As stated above, in case of a very strong trend, price can keep trading beyond the envelopes for an extended period.

Trend Following :

Trend Following
Fig. 3 – Trend Following

We discussed in the last section, the price can remain beyond the upper and lower envelopes for an extended period of time if the trend is very strong. Strong Trends can be captured by utilizing this tendency. The trick here is to choose the correct parameters for the envelope. The percentage selection will determine the use of the envelope. Generally higher percentage values will be suitable for Overbought/Oversold conditions and slightly lower percentage values will be suitable for trend following. The percentage of values will also depend on the volatility of the stock. Trend following signals can be as follows : 

Buy Signal: Close crosses above the upper envelope 

Buy Exit: Close crosses below the upper envelope or Close crosses below the moving average.

Sell Signal: Close crosses below the lower envelope

Sell Exit: Close crosses above the lower envelope or Close crosses above the moving average.

This method is a variation of a single moving average crossover system with a buffer. Essentially what we are doing over here is providing some percentage of butter over and below the moving average and trading only if crossover happens beyond this buffer. It can hence eliminate some of the whipsaws seen with single moving average crossover conditions. 

Creating and Backtesting Moving Average Envelope on Streak :

Strategy Backtesting
Fig. 4 – Strategy Backtesting

Here we are demonstrating how the envelope can be created on the Streak platform. The example shows how a mean reversion strategy can be created using a 2% envelope. When the price moves below the upper envelope, a sell is initiated. The exit will happen based on Target or Stoploss or Square off at the end of the day. ADX condition has been used so that trades happen only when ADX is below 24, indicating a sideways market.

To make use of Moving Average envelopes, we can similarly create Strategies as well as scanners.

Conclusion : 

Moving Average envelope is a very easy tool that can be used in multiple ways. The key here is to adjust the envelope parameters properly that is suitable to the kind of use and the stock volatility. Highly volatile stocks would require higher percentages for envelopes while low volatile stocks would do fine with lower values. Optimum parameters can be found by backtesting the strategies.


Disclaimer: The information provided is solely for educational purposes and does not constitute a recommendation to buy, sell, or otherwise deal in investments.