Moving averages smooth price data to reveal trend direction by filtering out short-term noise. The two fundamental types—Simple Moving Average (SMA) and Exponential Moving Average (EMA)—differ in how they weight historical data, leading to different responsiveness and lag characteristics.
Problem with SMA: When an old price drops out of the window, the SMA "jumps" because that entire n1 weight vanishes instantly. This creates step discontinuities.
Solution concept: Instead of fixed windows, use a recursive formula where every past price contributes, but with exponentially decaying weight.
Derivation:
Desired property: More recent prices should dominate. Let's say today's price gets weight α, and all prior history (summarized as yesterday's EMA) gets weight (1−α).
EMAt=αPt+(1−α)EMAt−1
Why this step? This is a weighted average of today's price and yesterday's smoothed value. The parameter α∈(0,1) controls responsiveness.
Choosing α: To make the EMA's "effective window" comparable to an n-period SMA, we set:
α=n+12
Why this step? This formula comes from matching the center of mass of the exponential decay to an n-period uniform window. Proof:
The infinite expansion of EMA is:
EMAt=αPt+α(1−α)Pt−1+α(1−α)2Pt−2+⋯
The weight on price k days ago is α(1−α)k. These weights sum to 1 (geometric series):
∑k=0∞α(1−α)k=1−(1−α)α==α1✓
The expected age (center of mass) is:
Age=∑k=0∞k⋅α(1−α)k=α1−α
For an n-period SMA, the average age is 2n−1. Setting these equal:
α1−α=2n−1
Solving for α:
2(1−α)=α(n−1)2−2α=αn−α2=αn+αα=n+12
Why this step? This ensures EMA(n) and SMA(n) have similar "lookback periods" but EMA responds faster because it never fully discards old data—it just diminishes it.
Imagine you're trying to figure out if it's getting hotter or colder outside, but the temperature jumps around a lot minute-to-minute. You could:
Method 1 (SMA): Every hour, average the last 10 minutes. At1:00, you average 12:50-1:00. At 1:01, you drop 12:50, add 1:01, and average the new 10 minutes. Each counts the same.
Method 2 (EMA): Instead of forgetting old minutes completely, you say "this minute's temperature is important, but so is the average I already calculated." You make a new average that's half today's temperature and half yesterday's average. Yesterday's average secretly includes the day before, and so on. So old temperatures fade out slowly like an echo, instead of vanishing suddenly.
The difference: Method 1 (SMA) reacts slower but is more stable. Method 2 (EMA) reacts faster but can be jumpy. If it's actually getting hotter, EMA figures it out quicker. If it's just a weird minute, SMA ignores it better.
For stocks, we want to know: "Is the price really going up, or just random noise?" Both methods help, but you pick based on whether you want to be fast (EMA) or careful (SMA).
What is the formula for an n-period Simple Moving Average? :: SMA_n = (P_1 + P_2 + ... + P_n) / n, where each price has equal weight 1/n.
What is the recursive formula for Exponential Moving Average?
EMA_today = α·P_today + (1-α)·EMA_yesterday, where α = 2/(n+1).
Why does SMA create "step discontinuities" when a price drops out?
Because when an old price exits the window, its full1/n weight vanishes instantly, causing a sudden jump in the average.
What is the key difference in how SMA and EMA treat old data?
SMA gives equal weight to all n prices and completely discards older data. EMA gives exponentially decaying weight to all historical data—old prices never fully vanish.
What is the formula for the EMA smoothing factor α?
α = 2/(n+1). This makes the EMA's effective lookback period comparable to an n-period SMA.
Why do we initialize EMA with the first n-period SMA instead of the first price?
Starting with P_1 creates massive initialization bias. If early prices are unrepresentative, the EMA takes many periods to converge due to the compounding effect of (1-α).
In what market condition does EMA generate more false signals than SMA?
In sideways or choppy markets, EMA's higher responsiveness produces more whipsaws (false breakout signals) because it reacts to short-term noise.
What is the "effective age" or center of mass for an n-period EMA?
(1-α)/α = (n-1)/2, which matches the average age of an n-period SMA. This justifies the α = 2/(n+1) formula.
Why is the200-day SMA widely used as support/resistance?
Its lag and widespread institutional use create self-fulfilling prophecies—many traders watch it, so price often bounces at that level.
If α = 0.1 for an EMA, what percentage weight does today's price receive?
10%. The remaining 90% is the prior EMA value, which recursively embeds all historical prices.
What happens to SMA when the oldest price in the window equals the newest price?
The SMA remains unchanged because the drop and add cancel out: SMA_new = SMA_old + (P_new - P_old)/n = SMA_old when P_new = P_old.
For a 20-period EMA, approximately what weight does a price from20 days ago have?
α(1-α)^20 ≈ 0.095 × (0.905)^20 ≈ 0.095 × 0.134 ≈ 1.3%. Still present but heavily diminished.
Moving averages stock market mein trend ko samajhne ke liye bahut important hai. Jaise kiagar tum kisi hyperactive bache ko track kar rahe ho jo circle mein bhag raha hai, toh agle second ko predict nahi kar sakte, lekin last10 minutes ka average position dekho toh pata chalega ki wo ice cream truck ki taraf jaa raha hai. Yahi kaam moving averages karte hain—wo short-term noise ko filter karke underlying trend dikhate hain.
Do main types hain: Simple Moving Average (SMA) aur Exponential Moving Average (EMA). SMA bahut seedha hai—last "n" days ke prices ko add karke "n" se divide karo. Har din ka equal weight hota hai. Lekin problem yeh hai ki jab ek purana price window se bahar nikalta hai, SMA suddenly jump karta hai. EMA is problem ko solve karta hai by giving recent prices zyada weight. Formula recursive hai: aj ka EMA = alpha × (aj ka price) + (1 - alpha) × (kal ka EMA). Yahan alpha = 2/(n+1), jo decide karta hai kitni jaldi EMA respond karega.
Trading mein, SMA zyada stable hai lekin late signals deta hai—chopy markets ke liye acha hai jahan false breakoutszyada hote hain. EMA fast response deta hai, trending markets mein early entry/exit milta hai, lekin sideways markets mein zyada whipsaws (false signals) bhi de sakta hai. Professionals aksar dono ka combination use karte hain—jaise 50-day SMA aur 200-day SMA ka golden cross (bullish signal) ya phir MACD indicator jo12-day aur 26-day EMAs ka difference use karta hai. Core concept yeh hai: SMA stability deta hai, EMA speed deta hai—tumhe apni trading style ke hisaab se choose karna padega.