The Art of Calculating Exponential Moving Average

robot
Abstract generation in progress

EMA calculation isn't quite as straightforward as the Simple Moving Average. It's a bit more nuanced. EMA puts extra weight on recent prices through something called a multiplier. Kinda makes it more responsive to new trends.

Here's how you do it:

  1. Pick how many periods you want.

  2. Find your smoothing factor: SF = 2 / (N + 1) N is just your number of periods. Simple math.

  3. Start with the SMA of your first period. This becomes your first EMA value.

  4. Then for each new price: EMA = (Current Price − Previous EMA) × SF + Previous EMA

  5. Just keep going.

Let me show you. Say we're tracking a stock over 10 days: $25, $27, $26, $28, $29, $31, $30, $29, $28, and $27.

For our 10-day EMA:

The smoothing factor works out to about 0.1818.

Our starting EMA equals $28 (the 10-day SMA).

Next day: EMA = ($27 − $28) × 0.1818 + $28 = $27.1818

You'd just keep doing this as new prices come in.

On charts, the EMA line seems to help traders spot opportunities. Not foolproof though.

Picking your EMA period depends on what you're after. Short periods (like 5 or 9) react fast but might trigger false alarms. Longer ones (20 or 50) look smoother but they're a bit slow to catch what's happening right now.

This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
0/400
No comments
  • Pin
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate App
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)