How it works
Envelopes are the oldest and simplest band construction: take a moving average and draw two lines a fixed percentage above and below it. There is no volatility estimate anywhere in the calculation. The width is a number the trader chooses and it stays where it was put until it is changed. That sounds like a defect next to Bollinger and Keltner, and often it is, but the fixed width also gives the tool a property the adaptive envelopes lack.
That property is stability of meaning. When a Bollinger band widens, a subsequent band touch is a different event from the one before it, because the yardstick moved. With a fixed-percentage envelope, a touch of the upper line always means the same thing: price is exactly that percentage above its average. For an analyst calibrating how far a particular instrument typically extends before it pulls back, that consistency is genuinely useful, and it is why fixed envelopes survive in long-horizon index work where the appropriate percentage is stable across decades.
The classic use is mean reversion in markets with a well-behaved oscillation around a trend. Set the percentage so that the envelope contains most price action over a long history, then treat excursions beyond it as stretched. A second, less obvious use is as a noise filter for a moving average crossover system: requiring price to exceed the average by a set percentage before a signal counts removes most of the whipsaws that occur when price is hovering directly on the line.
The trade-off against adaptive envelopes is stark and should drive the choice. When volatility doubles, a fixed envelope is suddenly far too narrow and price sits outside it constantly; when volatility halves, it is too wide and never gets touched. Bollinger and Keltner solve exactly this at the cost of a moving yardstick. Envelopes are the right choice when the analyst wants a fixed reference and is willing to maintain it, and the wrong choice for any automated system meant to run unattended across regimes.
Calculation
The arithmetic in words, in the order it happens.
Compute a moving average of the close over N periods, conventionally a 20-period simple moving average, as the centre line. The upper envelope is the average multiplied by one plus the chosen percentage divided by 100; the lower envelope is the average multiplied by one minus the same fraction. With the common default of 10 percent, an average of 200 gives an upper line at 220 and a lower line at 180. Because the offset is multiplicative rather than additive, the absolute distance between the lines scales with price level, which keeps the envelope proportionate as an instrument appreciates over years.
Source
An AlgoBeamScript implementation of the formula above, written by us from the arithmetic so the code and the calculation agree line for line.
Runs unchanged on the platform and in the AlgoBeamTS runtime. The language reference is in the documentation.
Inputs
Defaults are the values most charting packages ship with. They are conventions, not optimal settings — the right length depends on your instrument and your holding period.
| Input | Default | What it changes |
|---|---|---|
| Length | 20 | Bars in the centre average. Short lengths make the envelope follow price closely so touches are frequent and shallow; long lengths give a slow spine that price departs from for extended stretches. |
| Percent | 10 | Half-width of the envelope as a percentage of the average. This is the setting that must be matched to the instrument: ten percent is far too wide for a currency pair and far too narrow for a small-cap growth stock. |
| Average type | SMA | Smoothing used for the centre. An exponential average turns the envelope faster after a sharp move, which reduces the period during which price sits outside a stale band. |
| Source | Close | Price series feeding the average. Closes are standard; using typical price makes the centre marginally steadier on instruments with erratic closing auctions. |
How to read it
What practitioners take from the plot. Read these as descriptions of market state, not as entry signals.
- Price touching the upper envelope
- The market is exactly the configured percentage above its average, a fixed and comparable statement about stretch rather than a volatility-adjusted one.
- Price outside the envelope for many bars
- Either a genuine trend or an envelope whose percentage has not kept up with a rising volatility regime. Check the width before drawing conclusions.
- Price oscillating cleanly between the two lines
- The width is well calibrated for current conditions and the envelope is usable as a reversion reference.
- Envelope never touched for months
- Volatility has fallen below what the setting assumes. The percentage needs to be reduced or the tool has stopped conveying information.
Limitations
Where this indicator misleads. None of these are fixed by a better parameter.
- The width is fixed and volatility is not, so the same setting is too tight in a shock and too loose in a calm regime. This is the entire reason adaptive envelopes were invented.
- The correct percentage differs by instrument and by timeframe and has to be found empirically, which invites curve fitting to whatever history was on screen.
- The centre is a moving average and lags accordingly, so during a sharp reversal both lines are still pointing the wrong way.
- In a sustained trend price rides outside the envelope for long stretches and any rule that fades the touch loses continuously.
Educational reference. This page explains how an indicator is built and how it is commonly read. It is not investment advice, not a recommendation and not a signal service. No indicator is profitable on its own — each is a way of describing a market, and any rule built on one has to be tested with realistic costs before it is traded.