# SMA vs EMA

SMA and EMA are both moving averages, but they weight price data differently. SMA gives equal weight to all periods; EMA emphasizes recent prices, making it more responsive.

## Side-by-side comparison

| Feature | SMA | EMA |
| --- | --- | --- |
| Weighting | Equal weight to all periods | More weight to recent prices |
| Responsiveness | Slower, smoother | Faster, more reactive |
| Best for | Long-term trend identification | Short-term trading signals |
| Lag | Higher | Lower |
| Noise | Less noise | More noise (more signals) |
| CommonQuant DSL | sma(period) | ema(period) |

## Frequently asked questions

### Should I use SMA or EMA for day trading?

EMA is generally preferred for day trading because it reacts faster to price changes. SMA is better for swing trading or identifying long-term trends.

### Why do traders use both SMA and EMA?

Combining a slow SMA with a fast EMA creates crossover strategies. The SMA defines the trend, while the EMA provides entry/exit signals.

Canonical: https://commonquant.ai/compare/sma-vs-ema
