Skip to main content

Posts

Showing posts from August, 2024

Difference Between Exponential Moving Average (EMA) & Simple Moving Average (SMA)

 Difference Between Exponential Moving Average (EMA) & Simple Moving Average (SMA) 1. Simple Moving Average (SMA): Calculation : SMA is the average of prices over a specific number of periods. Each price in the period is equally weighted. Formula : SMA = P 1 + P 2 + . . . + P n n \text{SMA} = \frac{P_1 + P_2 + ... + P_n}{n} SMA = n P 1 ​ + P 2 ​ + ... + P n ​ ​ where P 1 , P 2 , . . . P n P_1, P_2, ... P_n P 1 ​ , P 2 ​ , ... P n ​ are the prices over n n n periods. Example : If you're calculating a 5-day SMA with prices [10, 12, 14, 16, 18], the SMA is: SMA = 10 + 12 + 14 + 16 + 18 5 = 70 5 = 14 \text{SMA} = \frac{10 + 12 + 14 + 16 + 18}{5} = \frac{70}{5} = 14 SMA = 5 10 + 12 + 14 + 16 + 18 ​ = 5 70 ​ = 14 2. Exponential Moving Average (EMA): Calculation : EMA gives more weight to recent prices, making it more responsive to new information. It uses a smoothing factor (usually denoted as α) which gives more importance to the latest data points. Formula : EMA = (Current Price