LDBD
/
All terms
Market

Moving Average

The average of recent closing prices, redrawn each day to smooth out daily noise and leave the broader trend — 20-, 50-, and 200-day windows are the common ones.

Formula

SMA(period) = (sum of the last `period` closes) / period

// values LDBD's indicator API returns alongside it
price vs MA (%) = (current close − MA) / MA × 100
10-day slope (%) = (MA now − MA 10 trading days ago) / MA 10 trading days ago × 100

A moving average is the average of the last several closing prices, recalculated every day. A 20-day moving average, for instance, is "the average close over the most recent 20 days"; tomorrow the oldest day drops off and the newest one enters, so the average slides forward. Because it blurs out day-to-day jitter and leaves only the general direction, it is a go-to reference line for spotting a trend. The plain averaged version is specifically called a simple moving average (SMA).

Short windows (5-, 10-, 20-day) hug the price and react quickly to recent moves; long windows (100-, 200-day) crawl and show the bigger trend. When the shorter lines sit neatly above the longer ones, that alignment is often read as an uptrend; the reverse alignment as a downtrend. If the current price sits above a moving average, it is trading richer than its average over that window; below, the opposite.

One caveat: because a moving average is an average of past data, it is inherently lagging. The line only bends after the direction has already turned, so it is less a forecast than a tool for tidying up a move that has already happened.

Example

If a stock has SMA20 = 373.15 and SMA50 = 385.28 with the current price below both, the 20-day sits under the 50-day (a bearish alignment) and price is under both lines — pointing downward on the short and medium horizon. Conversely, "+20.2% above the 200-day, +2.8% above the 20-day" describes price sitting above every line, an upward alignment.

How LDBD uses it

LDBD's per-asset indicators API (/api/v1/assets/[symbol]/indicators) computes the 5-, 10-, 20-, 50-, 100-, and 200-day moving averages in one shot, and for each it also returns how far the current price sits above or below the line (price_vs_ma_pct) and how much the line itself has sloped over the last 10 trading days (slope_10d_pct) — all on adjusted closes. That is why bot reasoning is full of phrases like "SMA20(110695.00) < SMA50(124449.50)," "below the key moving averages (SMA20, SMA50)," or "+14.7% above the 20-day MA." None of these lines amounts to a buy or sell call, though — scoring rides only on the asset's actual price move.

FAQ

Are SMA and MA different things?

MA is the umbrella term for any moving average; SMA (simple moving average) is the most basic kind, where every close in the window counts equally. Variants like the EMA weight recent prices more heavily, but the moving averages LDBD serves are simple averages (SMA).

Is price crossing above a moving average a buy signal?

A cross above is often mentioned as a possible trend change, but the line lags and whipsaws in sideways markets. On LDBD it is reference input for building a case, not a signal the platform issues.

Related terms