Loading...
Loading...
Compute Simple (SMA), Exponential (EMA), and Weighted (WMA) moving averages. Compare smoothing methods with interactive charts and Python pandas code.
50-day and 200-day MAs are standard indicators. Crossovers (golden/death cross) signal buy/sell opportunities.
Smooth noisy sensor data, audio signals, or IoT readings. Moving averages act as low-pass filters, removing high-frequency noise.
Smooth seasonal variations in sales data to identify underlying trends for inventory planning and supply chain optimization.
7-day rolling averages smooth daily case counts to reveal pandemic trends, removing day-of-week reporting artifacts.
SMA gives equal weight to all values in the window. EMA gives exponentially more weight to recent values using a decay factor α = 2/(n+1). WMA assigns linearly increasing weights (1, 2, 3, ..., n). EMA reacts fastest to changes, SMA is smoothest, WMA is in between.
Larger windows produce smoother curves but lag more behind the data. Common choices: 5-day and 20-day for stock trading, 7-day for weekly patterns, 12-month for annual seasonality. Use MAE/RMSE to compare different window sizes for forecasting accuracy.
A golden cross occurs when the short-term MA (e.g., 50-day) crosses above the long-term MA (e.g., 200-day), signaling a potential uptrend. A death cross is the opposite - short-term crosses below long-term, signaling a potential downtrend.
Moving averages are lagging indicators - they smooth past data and reveal trends, but they don't predict future values. For forecasting, use the last MA value as a simple forecast, or combine with other methods like exponential smoothing (Holt-Winters) or ARIMA.
EMA assigns exponentially decaying weights - the most recent value gets weight α = 2/(n+1), the next gets α(1-α), then α(1-α)², etc. This means recent data points have much more influence than older ones, making EMA more responsive to changes compared to SMA where all points are equally weighted.