Your interactive trading laboratory!
27 users online

Indicator Spotlight - EMA

The Exponential Moving Average indicator smooths the source data with an ever-decreasing exponent. The weighting for each older data point decreases exponentially, never reaching zero.

Quantacula Code

EMA myEMA50 = new EMA(bars.Close, 50);
EMA myEMA200 = EMA.Series(bars.Close, 200);


  • source (TimeSeries)
  • period (int)


First, an exponent value is calculated:

exponent = 2 / (period + 1)

The first EMA value is then assigned to the first value in the source TimeSeries. Subsequent values are calculated using this formula:

EMA = exponent * (source data - previous EMA) + previous EMA


EMA is interpreted in the same way as the Simple Moving Average (SMA). Since EMA is more sensitive to recent data values, it typically responds more quickly to changes in the underlying source data.

  • The trend is typically considered Bullish when prices are above the EMA.
  • The trend is typically considered Bearish when prices are below the EMA.
  • Bullish signals occur when a fast-period SMA crosses over a slow-period EMA.
  • Bearish signals occur when a fast-period SMA crosses under a slow-period EMA.
  • In sideways markets, spurious EMA crossovers can occur frequently. This phenomenon is known as whipsaws.

Indicator Lab

The chart below lets you see how the EMA compares to the SMA. Use the slider to change the period of both moving averages and see the results update on the chart dynamically.

Charts powered by JuicyCharts, Quantacula's custom web charting engine. Would you like JuicyCharts for your web site? Contact us for more info!

Models Using EMA
Could not find any Models that use this indicator.