What is EMA?
An exponential moving average draws a single line through price with the short-term noise taken out, so a trend is easier to see than it is on the candles alone. It weights recent bars more heavily than older ones, which is why it turns sooner than a simple average of the same length.
EMA smooths price to help identify trend direction. It does not independently confirm trend strength or predict future prices.
How to use EMA
- Price above or below the line. Price holding above the EMA is read as context for an uptrend, below it for a downtrend.
- The slope. A rising line means recent closes have been above older ones. A flattening line usually means the move has stalled.
- A fast and a slow EMA crossing. When a shorter EMA crosses a longer one, the recent window has overtaken the longer one. That is the idea behind the EMA 20/50 crossover with ATR stop.
- Period length. Shorter reacts sooner and signals more often; longer is smoother and later. That trade-off is the setting.
These are ways to read the line, not entry signals on their own.
Settings
| Setting | Default | What it changes |
|---|---|---|
| Length | 9 | Bars in the average. Lower turns sooner and whipsaws more; higher is smoother and later. Minimum 1. |
| Source | Close | Which price each bar contributes. Open, high, low and the averaged sources such as hl2 and hlc3 are also available. |
Adjust the period and price source in the indicator settings.
Calculation
Each bar, the EMA moves the previous value a fraction of the way towards the new price. That fraction is the smoothing factor:
alpha = 2 / (length + 1)
EMA = alpha * price + (1 - alpha) * previous EMA
With a length of 9, alpha is 0.2, so each new bar pulls the average a fifth of the way towards itself. A longer length means a smaller alpha and a slower line. Because the weights decay rather than stopping, there is no fixed window: the average is started from the simple average of the first bars available and settles from there.
Limitations
- It lags. An EMA is built from past prices, so it describes what has already happened. A faster setting trades lag for noise rather than removing it.
- Sideways markets produce repeated false crossovers. With no trend to follow, the line crosses price again and again.
- The live candle moves. The current bar's value changes until that bar closes.
- It depends on timeframe, period and source. The same indicator gives a different line on 15m than on 1D, or on close against hl2.
- It is not a strategy. On its own it carries no risk management, sizing or exit.
Frequently asked questions
An exponential moving average is an average of past prices that weights recent bars more heavily than older ones. Each bar it moves the previous average a fraction of the way towards the new price, so it follows price more closely than an average that treats every bar in its window equally.
A simple moving average weights every bar in its window equally and drops a bar entirely once it leaves that window. An EMA's weights decay geometrically, so every bar it has seen still contributes something and there is no hard window edge. In practice the EMA turns sooner after a change in price and the simple average is smoother. Altrady Charts ships both, as Moving Average and Moving Average Exponential.
There is no single best period, only a trade-off. A shorter length reacts sooner and produces more signals, including more false ones when the market is choppy. A longer length is smoother and later, so it misses the start of a move but reacts less to noise. The built-in default is 9. Choose the length for the timeframe you trade and test it, rather than adopting a number because it is widely quoted.
Yes. The indicator declares two inputs: Length, default 9 with a minimum of 1, and Source, default close. Open the indicator's settings on the chart to change them. Source accepts any of the available price series, including open, high, low and the averaged sources such as hl2 and hlc3.
Values on bars that have already closed are not revised. The current candle's EMA moves while that candle is still live and settles when it closes, which is normal for any moving average. One caveat is worth knowing: the average needs a starting point, so scrolling back to load older history recalculates it and values near the very start of the loaded range can shift.
Use the Add to chart button at the top of this page. It opens BTC/USDT on Binance in the Altrady Charts terminal with the built-in Moving Average Exponential already applied. On any other market, open the indicator picker on the chart and choose Moving Average Exponential from the Moving Average group.
Yes. The library's EMA 20/50 crossover with ATR stop is built on it, using a fast and a slow EMA to produce its signals. Running and backtesting a strategy needs an Altrady account. The strategy page lists the full rules, the settings and the script.