Concept

Swing Structure Grammar

Swing Structure Grammar, also known as HH/HL/LH/LL, uptrend/downtrend/range definitions, structure mapping, is a Market Structure concept. The Library holds 17 implementations, each one a working definition you can pull into Quant.

Top Swing Structure Grammar indicators

The top custom implementations, built on the original standard Swing Structure Grammar formula.

17 total

Want to trade Swing Structure Grammar? Any of the 17 implementations below is one prompt away from a backtested strategy in Quant.

What is Swing Structure Grammar?

Swing structure grammar is the labeling system that turns a series of swing highs and lows 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: 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, a counter-trend break a 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 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. 1Detect swing highs and lows with a chosen strength. Every downstream label is relative to this setting, so hold it constant while you map.
  2. 2Label each confirmed swing against the last swing of the same type: HH or LH for highs, HL or LL for lows.
  3. 3Read the sequence: alternating HH and HL is an uptrend, LH and LL a downtrend, and overlapping labels with no progression mark a range.
  4. 4Track 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 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 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 between them filters counter-trend noise out of entries.

Swing structure grammar vs related concepts

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: 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: 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: 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.

More Swing Structure Grammar implementations

Concept family

Market Structure

31 concepts mapped · 31 in the Library

Swing Structure Grammar FAQ

Turn Swing Structure Grammar into a trading strategy.

Take any implementation from this page into Quant, then build on it, backtest it on real data, and keep refining it in conversation.