Back

Moving averages and lag

P05-L05 · P05 · P05-M02

Compute smoothing and demonstrate response delay

ILLUSTRATIVE · needs_review

Prerequisites: P05-L04

Learning objectives

  • Compute smoothing and demonstrate response delay
  • Calculate a declared rolling mean.
  • Demonstrate lag without moving results backwards.

EN source master · P05-L05 · 30 minutes estimated · needs_review

Offline formative study. No wallet connection, real funds, private keys, signatures, live trade or personal portfolio inputs. Visuals are specifications. This source master remains needs_review; completing the formative exercise does not issue certification.

Why this matters

Smoothing can make a chart easier to read while hiding the delay and information lost in aggregation.

Explanation

Define the arithmetic

A simple moving average assigns equal weights to the most recent n sampled values [SMA]. At index t, SMA(n)=sum of values t−n+1 through t divided by n. Here the source is the completed-bar close, offset zero. Before n observations, no value is available under our convention.

Inspect response instead of forecasting

With three closes at 100, a sudden close at 130 lifts the three-period mean to 110, then 120, then 130 if two more 130 closes follow. The mean's slower change follows directly from older values retaining weight. A longer window retains more older information. No average knows the next observation.

Preserve time and parameters

Moving the plotted average backwards is a display choice and must never be presented as earlier knowledge. Changing source from close to high or changing interval changes inputs. A three-hour average is not a three-day average. Data corrections can invalidate a previously published calculation.

Know the tradeoff

Smoothing reduces variation in the displayed series but can erase abrupt changes. In an alternating regime, repeated crossings are false positives for any persistent-direction story. A trending-looking segment and a flat segment can require different descriptions; selecting length after inspecting results is retrospective tuning. Record the sampling rule, window, offset, lag and unresolved future path. Crossing a mean is only an observed comparison.

Key terms

  • SMA (simple moving average): equal-weight rolling average.
  • Window: number of sampled inputs.
  • Offset: plotted displacement, not information availability.
  • Lag: delayed response caused by older weighted inputs.

Historical example

ILLUSTRATIVE closes T1–T6: 100,100,100,130,130,130. No missing observations. SMA3 uses complete closes; offset=0. Alternate series U1–U5: 90,110,90,110,90, used only to inspect unstable comparisons.

Visual specifications

Plot supplied close points and SMA3 at T3–T6, annotate first availability and responses 100/110/120/130. No full candles without OHLC. Separate alternating-series panel; no directional arrows.

What the evidence proves

The original fixture's rolling arithmetic and delayed response.

What the evidence does not prove

A predictive crossover, an optimal length or a performance advantage.

Evidence classifications

  • OBSERVED: FIX-P05-L05 stipulates T4=130.
  • INFERRED: SMA3 at T4 is 110 under the supplied formula.
  • UNKNOWN: T7 close.
  • INSUFFICIENT EVIDENCE: SMA3 crossing yields profitable outcomes.

Common mistakes

  • Dividing by six for a three-point window.
  • Plotting results before inputs exist.
  • Treating a tuned parameter as universal.

Practical exercise

Compute all available SMA3 values and SMA5 at T5/T6. Compare delay after T4. Explain why changing the plotting offset cannot improve information availability.

Deliver calculations or annotations, claim/source table and limitations. Suggested allocation: study 12 minutes, exercise 8, correction/quiz 10; estimate subject to calibration.

Show worked correction

SMA3 T3=300/3=100; T4=330/3=110; T5=360/3=120; T6=390/3=130. SMA5 T5=(100+100+100+130+130)/5=112; T6=(100+100+130+130+130)/5=118. The longer mean is still below 130. A negative plotting offset relocates a later result visually; it does not supply the result earlier.

Formative rubric (5 points): reproducible inputs, correct method, correct result, claim-specific evidence scope, explicit limitations. Invented observation, advisory output or unsupported safety claim requires correction regardless of score.

Checklist

  • Name source and interval.
  • Preserve window and offset.
  • Leave unavailable means blank.
  • State lag and regime limits.

Summary

A moving average is a parameterized transformation of past inputs; its clarity comes with delay and lost detail.

Summary

  • Calculate a declared rolling mean.
  • Demonstrate lag without moving results backwards.

Next lesson

P05-L06 after correction review.

Tools

NONE in the authoritative catalog. The supplied offline fixture/package is sufficient; no paid feature or unverified Production capability is required. Lab/certification metadata denotes downstream associations, not access gates or live awards.

Sources & claim boundaries

Visual specifications

P05-L05-V01

SPECIFICATION_ONLY · ILLUSTRATIVE

Compute smoothing and demonstrate response delay

ILLUSTRATIVE — fictional inputs; no signal or safety guarantee.

Plot supplied close points and SMA3 at T3–T6, annotate first availability and responses 100/110/120/130. No full candles without OHLC. Separate alternating-series panel; no directional arrows.

Plot supplied close points and SMA3 at T3–T6, annotate first availability and responses 100/110/120/130. No full candles without OHLC. Separate alternating-series panel; no directional arrows.

At 390px stack chart/table, assumptions, correction and source panel; provide complete text equivalent. Rendering pending.

RTL explanatory prose; numeric values, IDs and chronological axes stay LTR; preserve dependency directions.

FIX-P05-L05

Sources & claim boundaries

Dataset provenance

id: FIX-P05-L05

dataStatus: ILLUSTRATIVE

observedAt: null

timeBasis: T/SIM markers are fictional order, not timestamps.

source: Author-created fixture embedded in this lesson.

scope: No market observation, usable address, secret, signature or personal financial data.

Test your reasoning

P05-L05-Q1 · What is SMA3 at T5?
P05-L05-Q2 · When does SMA3 first exist?
P05-L05-Q3 · What is SMA5 at T6?
P05-L05-Q4 · What does negative plot offset change?
P05-L05-Q5 · What does a close/mean crossing establish?