# Swing Structure Grammar

Also known as: HH/HL/LH/LL, uptrend/downtrend/range definitions, structure mapping.
A Market Structure concept (Swing grammar) in the LuxAlgo Library, with 17 indicator implementations.

## What is Swing Structure Grammar?

Swing structure grammar is the labeling system that turns a series of [swing highs and lows](https://www.luxalgo.com/library/concept/swing-high-low/) into a trend statement. Each confirmed swing is compared with the previous swing of the same type: a high above the prior high is a higher high (HH), below it a lower high (LH); lows label as higher lows (HL) or lower lows (LL). The resulting sequence of labels is the market's structure.

The reading rules descend from [Dow Theory](https://www.luxalgo.com/library/concept/dow-theory/): an uptrend is a run of higher highs and higher lows, a downtrend a run of lower highs and lower lows, and anything overlapping or mixed is a range. The grammar stays intact until a defining swing gives way, which is where structure events are declared: a with-trend break is a [break of structure](https://www.luxalgo.com/library/concept/break-of-structure/), a counter-trend break a [change of character](https://www.luxalgo.com/library/concept/change-of-character/).

The grammar matters because it makes trend an objective, testable property of price rather than an impression. That objectivity is conditional, though: the labels depend entirely on the swing-detection setting underneath, and the same chart can print a clean uptrend on external swings while [internal structure](https://www.luxalgo.com/library/concept/internal-vs-external-structure/) chops sideways. Knowing which layer of structure you are labeling is most of the skill.

## How to map swing structure

Structure mapping is mechanical once the swings are fixed; the discipline is keeping the rules constant.

1. Detect swing highs and lows with a chosen strength. Every downstream label is relative to this setting, so hold it constant while you map.
2. Label each confirmed swing against the last swing of the same type: HH or LH for highs, HL or LL for lows.
3. Read the sequence: alternating HH and HL is an uptrend, LH and LL a downtrend, and overlapping labels with no progression mark a range.
4. Track the defining swings. In an uptrend the most recent higher low protects the trend; when it breaks, the grammar either flips or degrades into a range, and the next few labels decide which.

## How traders use it

- As a trend filter: many systems only take longs while the chart prints HH/HL sequences, a price-anchored alternative to a [higher-timeframe trend filter](https://www.luxalgo.com/library/concept/higher-timeframe-trend-filter/) built from moving averages.
- As the substrate for events: BOS and CHoCH are not independent signals; they are grammar statements about which labeled swing just broke, so the event stream is only as good as the labeling underneath it.
- As an entry map: in an uptrend, each prospective higher low is a [pullback](https://www.luxalgo.com/library/concept/pullback/) location where continuation setups are hunted, with the prior swing as the natural invalidation.
- As a multi-timeframe framework: mapping structure on a higher and a lower timeframe and requiring [alignment](https://www.luxalgo.com/library/concept/multi-timeframe-structure-alignment/) between them filters counter-trend noise out of entries.

## Swing structure grammar vs related concepts

- **Swing High/low** (https://www.luxalgo.com/library/concept/swing-high-low/): Swings are the raw pivots; the grammar is the labeling layered on top. You can detect swings without labeling them, but you cannot label structure without swings underneath.
- **Dow Theory** (https://www.luxalgo.com/library/concept/dow-theory/): The ancestor. Dow defined trend as advancing peaks and troughs long before the HH/HL shorthand existed; swing structure grammar is that definition made mechanical enough to code.
- **Break of Structure** (https://www.luxalgo.com/library/concept/break-of-structure/): A BOS is a single event inside the grammar (a with-trend swing break); the grammar is the ongoing bookkeeping that makes such events definable at all.
- **Trend Regime Label** (https://www.luxalgo.com/library/concept/trend-regime-label/): A regime label classifies trend from indicator conditions (slopes, bands, composites); structure grammar classifies it from the raw swing sequence. They often agree, and their disagreements tend to mark transitions.

## FAQ

### Is there one correct definition of an uptrend?

The common reading, inherited from Dow, is successive higher highs and higher lows. In practice definitions diverge on the details: which swing strength to use, whether a wick or a close breaks a swing, and whether internal or external swings count. Structure claims are only comparable when made under the same rules, so state your conventions explicitly.

### What officially ends an uptrend in market structure terms?

The most common convention: the uptrend is in question once the most recent higher low breaks (a change of character), and a downtrend is confirmed once price then prints a lower high and breaks a lower low. A single broken swing rarely settles the matter; the labels that form afterward do.

### Why do two indicators disagree about market structure on the same chart?

Because structure is parameter-relative. Different swing strengths, wick-versus-close break rules, and internal-versus-external swing choices produce different label sequences from identical bars. Neither is wrong; they describe structure at different resolutions. Match the settings before comparing tools, and pick the resolution that fits your holding period.

### Do I label structure with wicks or closing prices?

Both conventions exist. Wick-based labeling treats every traded extreme as structural, which reacts earlier but counts more noise and stop runs. Close-based labeling waits for bodies to confirm, which lags but filters sweeps. A common hybrid marks swings with wicks and requires closes to declare breaks; whichever you choose, keep it fixed.

## Implementations in the Library

- Swing Structure Scanner (LuxAlgo): https://www.luxalgo.com/library/indicator/swing-structure-scanner/
- HTF Swing Structure Signals (LuxAlgo): https://www.luxalgo.com/library/indicator/htf-swing-structure-signals/
- Candlestick Structure (LuxAlgo): https://www.luxalgo.com/library/indicator/candlestick-structure/
- Price Action Concepts (LuxAlgo): https://www.luxalgo.com/library/indicator/luxalgo-price-action-concepts/
- LuxAlgo - Screener (PAC) (LuxAlgo): https://www.luxalgo.com/library/indicator/luxalgo-screener-pac/
- Market Structure (Intrabar) (LuxAlgo): https://www.luxalgo.com/library/indicator/market-structure-intrabar/
- Market Structure Oscillator (LuxAlgo): https://www.luxalgo.com/library/indicator/market-structure-oscillator/
- Structure & Trend Dashboard (LuxAlgo): https://www.luxalgo.com/library/indicator/structure-trend-dashboard/
- kNN Market Architecture (LuxAlgo): https://www.luxalgo.com/library/indicator/knn-market-architecture/
- Trending Market Toolkit (LuxAlgo): https://www.luxalgo.com/library/indicator/trending-market-toolkit/
- Market Structure & Scatter Dashboard (LuxAlgo): https://www.luxalgo.com/library/indicator/market-structure-scatter-dashboard/
- Pure Price Action Structures (LuxAlgo): https://www.luxalgo.com/library/indicator/pure-price-action-structures/
- Market Structure Volume Distribution (LuxAlgo): https://www.luxalgo.com/library/indicator/market-structure-volume-distribution/
- Market Structure & Fibonacci Zones + RR (LuxAlgo): https://www.luxalgo.com/library/indicator/market-structure-fibonacci-zones-rr/
- Market Structure with Inducements & Sweeps (LuxAlgo): https://www.luxalgo.com/library/indicator/market-structure-with-inducements-sweeps/
- Pivot High/Low Analysis & Forecast (LuxAlgo): https://www.luxalgo.com/library/indicator/pivot-high-low-analysis-forecast/
- ICT Anchored Market Structures with Validation (LuxAlgo): https://www.luxalgo.com/library/indicator/ict-anchored-market-structures-with-validation/

## Related concepts

- Swing High/low: https://www.luxalgo.com/library/concept/swing-high-low/
- Zigzag Structure: https://www.luxalgo.com/library/concept/zigzag-structure/
- Williams Fractal: https://www.luxalgo.com/library/concept/williams-fractal/
- Multi-timeframe Structure Alignment: https://www.luxalgo.com/library/concept/multi-timeframe-structure-alignment/
- Pivot Strength: https://www.luxalgo.com/library/concept/pivot-strength/
- Swing Magnitude Filters: https://www.luxalgo.com/library/concept/swing-magnitude-filters/
- Fractal Nesting: https://www.luxalgo.com/library/concept/fractal-nesting/

---

Source: https://www.luxalgo.com/library/concept/swing-structure-grammar/ (LuxAlgo Library, the encyclopedia of trading & technical analysis). Free to use with attribution: https://www.luxalgo.com/library/license/