All indicators

Exponential Moving Average (EMA)

An exponential average with a warmup correction, so it is accurate from the first bar rather than crawling up from a zero start.

BTCUSD1h
Fixed data to Oct 6, 2026, UTC
Loading the chart

The EMA moves from its previous value toward the source by a fixed share of the distance each bar. The share is 2 / (Period + 1), so recent bars count most and the weight of older bars fades away geometrically.

The average starts from zero. Over the early bars it is divided by 1 - beta^n, where beta is 1 - 2 / (Period + 1) and n is the number of bars so far. That correction removes the bias of the zero start exactly, so the first value equals the first source value and the line is unbiased from there on. Once beta^n falls below 1e-10 the correction is switched off, because it no longer changes anything.

How to read Exponential Moving Average (EMA)

The EMA is the standard smooth trend line. Price above a rising EMA describes an uptrend, price below a falling one a downtrend, and the slope shows the direction. Two EMAs of different periods crossing each other is one of the most common trend signals.

It reacts faster than a simple average of the same period because it weights recent bars more, but it still lags price and gives false crossings in a sideways market. A longer period filters more noise and turns later.

Settings

Period
Sets the share of the distance the average moves each bar. Longer is smoother and slower.
Source
The price series that is averaged, the close by default.

Frequently asked questions

How does the warmup differ from a usual EMA?

A usual EMA starts from a simple average or the first value. This one starts from zero and divides by 1 - beta^n, which makes every early value an exactly weighted average of the bars seen so far.

Why is there a value on the first bar?

With the warmup correction, the first value is the first source value, so nothing needs to be left blank.

Write your own in OpenScript

Every study here is plain OpenScript. Change a setting, combine two, or turn one into a strategy, then backtest it in /trading and run it in sandbox trading (analyzer mode in OpenAlgo) before going further.