Overlap studies

Exponential Moving Average

Exponentially weighted moving average of closing prices.

Engine
TA-Lib
Function
EMA
Input series
close
Outputs
1

How it works

EMA applies greater weight to more recent close values while retaining information from earlier bars. TA-Lib marks EMA as having an unstable period.

Use case

Use EMA when a smoother trend feature should react faster to recent price changes than a simple moving average.

Parameters

ParameterTypeDefaultBounds or optionsDescription
Time Periodinteger301…100000Number of bars used for the EMA smoothing period.

Outputs

OutputTypeDescription
EMAnumberExponential moving average value for the bar.

Reading the result

EMA reacts more strongly to recent observations than an equal-length simple average. This makes it useful when recent movement should influence the baseline sooner, but it also makes the line more sensitive to short-lived changes.

Because the calculation carries state forward, an earlier source revision can influence later values. Compare final rows when validating the output against another platform.

Common mistakes

  1. Assuming an EMA period has the same effective smoothness as an SMA period with the same number.
  2. Treating faster reaction as better predictive information.
  3. Comparing two implementations without matching initialization and warmup history.
  4. Ignoring that a different starting history can leave a temporary tail difference.

DataCat workflow notes

Multiple EMA instances are often used to represent several horizons. Keep the set intentional: a dense ladder of neighboring periods can increase dataset width without adding much independent information.

Resources

Search documentation

Search across 46 documentation pages.