WHY average at all? Price Pt = trend + noise. n points ka average lene se zero-mean noise cancel ho jaata hai (law of large numbers ki wajah se noise term 1/n ki tarah shrink karta hai) jabki slow trend roughly intact rehta hai. Bada n ⇒ smoother lekin laggier.
Humein ek smoother chahiye jo (a) SMA se faster react kare aur (b) kabhi bhi saari purani prices store na kare. Socho: kya ho agar aaj ki smoothed value, aaj ki price aur kal ki smoothed value ka blend ho?
EMAt=αPt+(1−α)EMAt−1,0<α<1
Why this step? Yeh ek recursive ek-line update hai — sasta aur self-correcting. Ise ek baar unroll karo:
EMAt=αPt+α(1−α)Pt−1+α(1−α)2Pt−2+⋯
Toh weights geometrically decay karte hain — recent prices dominate karti hain. Ek n-period SMA ke "center of mass" se match karne ke liye hum choose karte hain:
α=n+12
Why n+12? EMA ka weighted mean lagα1−α periods hai. Ise SMA ke average lag 2n−1 ke barabar set karke solve karo:
α1−α=2n−1⇒α2−2=n−1⇒α=n+12.
WHY the spread trick? Do wiggly lines ko dekhne ki jagah, ek numberS dekho. Crossover simply "S zero hit karta hai" hai, jo code aur backtest karna bahut aasaan hai.
Socho tum ek ulte-seedhe hiking trail par fog mein chal rahe ho. Har pathar ko dekhne ki jagah, tum pichle 10 steps (fast lens) aur pichle 200 steps (slow lens) ki average direction dekhte ho. Jab teri short-term direction apni long-term direction se upar jaati hai, pahad shayad chadh raha hai — climbing shuru karo (buy). Jab neeche jaaye, waapas jao (sell). Lenses future nahi dekh sakte; woh sirf fog saaf karte hain taaki tum turn thoda late par lekin clearly notice kar sako.