> For the complete documentation index, see [llms.txt](https://help.za.velocitytrade.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.za.velocitytrade.com/desktop-application-for-windows/windows/technical-indicators/channels/mae-moving-average-envelope.md).

# MAE (Moving average envelope)

The Moving average envelope is an indicator that is based on a simple or exponential moving average and sets bands based on a given percentage deviation, thus creating envelopes. Then these envelopes can be used in two forms:

a) Envelopes can be used to determine the trend of a currency pair when the market is trending.

b) In cases where the market is range-bound, the moving average envelope indicator can also be used to indicate when a currency pair is oversold or overbought, just like a momentum oscillator would.

The Envelopes technical indicator is formed with two Moving averages, one of which is shifted upward and the other downward. The selection of the optimal relative number of band margins shifts is determined by market volatility: the higher it is, the stronger the shift.

Envelopes define the upper and lower margins of the price range. A sell signal appears when the price reaches the upper margin of the band; a buy signal appears when the price reaches the lower margin.

The logic behind the Envelopes is that overzealous buyers and sellers push the price towards extreme values (i.e., upper and lower bands), at which point the prices often stabilize, moving towards more realistic levels.

## Calculation

UPPER BAND = SMA (CLOSE, N) \* \[1 + K / 1000]

LOWER BAND = SMA (CLOSE, N) \* \[1 - K / 1000]

Where:

UPPER BAND — upper indicator line;

LOWER BAND — lower indicator line;

SMA — Simple Moving Average;

CLOSE — close price;

N — averaging period;

K / 1000 — shifting value from the average (measured in basis points).

## Main parameters

The parameters of the Moving average envelopes depend on your trading/investing goals and the characteristics of the security involved. Traders will likely use shorter (faster) moving averages and relatively tight envelopes. Investors will likely prefer longer (slower) moving averages with wider envelopes.

* Mode. Upper Line: Upper Band, Lower Line: Lower Band;
* Period: Averaging period for calculating the main line;
* Type of MA: Simple, Exponential, Modified, Linear weighted;
* Deviation: Percent deviation from the main line, default is 0.1;
* Source price for MA: Close, Open, High, Low, Median, Typical, and Weighted.

This indicator looks as follows on the chart:

![](/files/-MgF4C5jY33NMxaUkvMr)

Use a simple moving average in the envelope indicator when:

* The currency pair is not too volatile;
* A long-term trade focus is in view.

Use an exponential moving average in the envelope indicator when:

* The currency pair is volatile (a volatility indicator can help in this regard).
* The trade is going to be short-term.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.za.velocitytrade.com/desktop-application-for-windows/windows/technical-indicators/channels/mae-moving-average-envelope.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
