← Glossary

Indicators

Moving Average (SMA & EMA)

The average price over a rolling window, the basic trend-smoothing tool. SMA weights all bars equally; EMA weights recent bars more.

A moving average smooths price into a trend line. The two standard variants:

SMA(N) = (P₁ + P₂ + … + P_N) / N

EMA(N): EMA_t = α × P_t + (1 − α) × EMA_{t−1},   α = 2 / (N + 1)

The SMA treats every bar in the window equally. The EMA decays older bars exponentially, so it turns faster after a change in direction, at the cost of reacting to more noise.

Standard uses

The most common regime filter in systematic retail trading is a simple trend gate: only take longs while price is above the 200-period average. Crossovers are the next staple, where a fast average crossing a slow one (say EMA 12 over EMA 26) signals a momentum shift; that pair is the core of MACD. Trending markets also tend to pull back to a widely-watched average before continuing, which is why moving averages get treated as dynamic support.

The lag trade-off

Every moving average lags by construction, roughly half its window. Shorter windows cut lag and whipsaw in chop; longer windows hold trends and give back more at turns. No setting removes the trade-off. You can only choose where to sit on it, based on the strategy's timeframe and holding period.

On AlphaProve

Beyond ema and sma, the library carries wma, trima, hull_ma, and kama, four variants that trade lag against smoothness differently, with kama leaning on efficiency_ratio to speed up in trends and idle in chop. The no-code builder writes a crossover as an indicator-vs-indicator condition (fast average greater than slow) instead of a fixed number, and a per-indicator higher-timeframe label can pin the 200-period gate to the 4h chart while entries fire on the 15m.