TREND, MOVING AVERAGES & STRUCTURE

EMA (Exponential Moving Average)

Average price that weights recent days more heavily, so it turns faster than a plain average.

spec id: emalength (default 20)

What does EMA measure?

A smoothed price line that follows the trend. Price above it usually reads as an uptrend, below as a downtrend.

How is EMA calculated?

Average the last 20 closing prices — but give recent days more weight than old ones, so the line reacts faster when the price turns. It starts from a plain average of the first 20 candles and then updates a little with every new close.

Written by reading the engine’s real computation, not a textbook — where the two differ, the page describes what actually runs.

How do traders read EMA?

Price above a rising EMA = uptrend intact; a fast EMA crossing a slow one signals a momentum shift.

The honest caveat

Averages lag by design — the turn shows after the move started.

How do I use EMA in a bot?

Add indicator → EMA, set period. Appears as e.g. ema21. Use two (ema9, ema21) for crossovers.

Related indicators

Or browse all 158 indicators in the full library.

Build a bot that trades on EMA — the first backtest is free.

Run a free backtest