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:
Pick how many periods you want.
Find your smoothing factor: SF = 2 / (N + 1)
N is just your number of periods. Simple math.
Start with the SMA of your first period. This becomes your first EMA value.
Then for each new price: EMA = (Current Price − Previous EMA) × SF + Previous EMA
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.
The Art of Calculating Exponential Moving Average
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:
Pick how many periods you want.
Find your smoothing factor: SF = 2 / (N + 1) N is just your number of periods. Simple math.
Start with the SMA of your first period. This becomes your first EMA value.
Then for each new price: EMA = (Current Price − Previous EMA) × SF + Previous EMA
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.