← Back to Home
Trading Signal / Indicator
πŸ“‰

Exponential Moving Average (EMA)

A weighted average that reacts faster to recent price changes.

Start Automating Free β†’

Want to automate this strategy? Try auto-Trading free β€” no credit card required.

Exponential Moving Average (EMA) chart

Overview

What is Exponential Moving Average (EMA)?

The Exponential Moving Average (EMA) is a type of moving average that places greater weight on the most recent price data, making it more responsive to recent market changes than the Simple Moving Average (SMA). This sensitivity makes the EMA especially popular among shorter-term traders who need signals that react quickly to developing momentum.

The EMA is calculated using a multiplier: Multiplier = 2 Γ· (N + 1), where N is the number of periods. Each new EMA value is then: EMA = (Current Price Γ— Multiplier) + (Previous EMA Γ— (1 βˆ’ Multiplier)). This recursive formula means that older prices gradually carry less weight but never drop to zero entirely.

Common EMA periods and their uses: 9 and 21 EMA for short-term momentum signals; 20 and 50 EMA for medium-term trend detection; 50 and 200 EMA for long-term trend identification (the golden/death cross). The 200 EMA is widely watched by institutional traders as a dividing line between long-term bullish and bearish regimes.

EMAs serve multiple purposes: as dynamic support and resistance levels (price often bounces off the 20 or 50 EMA in trending markets), as crossover signals, as trend-direction filters, and as components of more complex indicators like MACD.

How It Works in auto-Trading

Automate It

In auto-Trading, EMA values are computed using streaming tick data to ensure accuracy at any timeframe. Users configure the EMA period in the strategy builder and choose whether to use it as a trend filter, crossover trigger, or dynamic support/resistance level. The builder visualises the EMA overlay on the chart preview so users can validate their settings before deployment.

Try Free β†’

Strategy Code

Pick a script below, copy it, and use it on your chart.

Pine Script (TradingView)

This is a TradingView Pine Script example for this indicator. Paste it into the TradingView Pine Editor, add it to your chart, and adjust inputs for your market and timeframe.

//@version=6
strategy("Exponential Moving Average (EMA)", overlay=true)
fastLen = input.int(20, "Fast Length")
slowLen = input.int(50, "Slow Length")
fast = ta.ema(close, fastLen)

Get full strategy code access

Enter your email address and full name to unlock this strategy code.

ThinkScript (thinkorswim)

This is a thinkorswim ThinkScript example for this indicator. Open thinkorswim, create a custom study, paste the script, and apply it to your chart.

input fastLength = 12;
input slowLength = 26;
def fastEMA = ExpAverage(close, fastLength);
def slowEMA = ExpAverage(close, slowLength);
def buySignal = fastEMA crosses above slowEMA;

Get full strategy code access

Enter your email address and full name to unlock this strategy code.

Ready to automate Exponential Moving Average (EMA)?

Join thousands of traders who use auto-Trading to execute this strategy automatically, 24/7.

Get Started Free β†’

All Strategies & Signals

Continue Learning

Trading Strategies

Trading Signals & Indicators