Backstrap
PatternSwings

Swing Highs and Lows

Pivot detection — bars that are local extremes within a configurable lookback window.

What it is

Swing detection is not an oscillator-style indicator; it is a structural primitive. A swing high is a bar whose high is higher than the surrounding N bars on each side. A swing low is the symmetric construct on the lows. Together they identify the pivots, peaks, and troughs that price action draws on a chart.

Swings are the foundation for higher-level analysis: trend structure (higher highs and higher lows = uptrend), Fibonacci retracements, divergence patterns, support/resistance lines, Wyckoff phases — all of these rely on having identified swing points first.

How it's calculated

For a swing-lookback parameter N (default 5):

A bar at index i is a swing high if:

High[i] > max(High[i−N..i−1]) AND High[i] > max(High[i+1..i+N])

A bar at index i is a swing low if:

Low[i] < min(Low[i−N..i−1]) AND Low[i] < min(Low[i+1..i+N])

Critically, a swing cannot be confirmed until N bars *after* it have closed. This introduces an inherent N-bar lag — but it is the price of robustness.

How to interpret signals

Trend structure. A sequence of higher swing highs and higher swing lows = uptrend. Lower highs and lower lows = downtrend. Mixed = transition or range.

Divergence anchor. RSI and MACD divergences require comparing price swings to indicator swings. Swing detection is the foundation for both.

Support / resistance. Recent swing highs become resistance levels; recent swing lows become support. These zones are statistically respected in many markets.

Strengths

  • Foundation for almost all structural analysis (Wyckoff, Elliott, divergence, S/R).
  • Lookback parameter (N) directly controls noise tolerance: small N = many small swings, large N = few major swings.
  • No ambiguity in the math — same swing detected by everyone with the same N.
  • Works on any timeframe and asset class.

Limitations

  • Inherent N-bar confirmation lag — by the time a swing is confirmed, price has already reversed away from it.
  • Choice of N is critical and subjective; different N values produce contradictory structural reads.
  • Real markets rarely produce textbook patterns; messy price action can obscure swings.
  • Detection is local — a swing high under a higher swing high a week ago may be irrelevant.

Common pitfalls

  • Reducing N to detect more swings — produces noise rather than insight.
  • Treating one swing as confirmation of trend change without context.
  • Drawing trend lines from cherry-picked swing points (selection bias).
  • Ignoring the confirmation lag — acting on suspected swings before they are confirmed.

Related strategies in Backstrap

Educational note: This page explains what Swings measures and how it is conventionally interpreted. It does not constitute investment advice. Past patterns do not guarantee future results, and no indicator works in all market regimes. See the full disclaimer.

Last updated: 2026-05-08