# Trends, ranges and swing points

> A simple, testable way to describe market structure with higher highs, lower lows and ranges.

Source: https://quantraider.com/learn/market-basics/trends-and-ranges

Course: Market basics and candlesticks (lesson 4 of 6) · Level: Beginner · 4 min

Most trading ideas start with a question: is the market going up, going down or going nowhere? Swing points give you a precise, testable way to answer that, instead of relying on how a chart feels at a glance.

## Swing highs and swing lows

A **swing high** is a candle whose high is higher than the highs of a chosen number of candles on each side of it. A **swing low** is the mirror image: its low is lower than the lows of the neighbouring candles. With two candles on each side, for instance, a high must be above the two candles before it and the two after it.

The number of candles on each side is a setting you choose. A small number finds many small swings, while a larger number finds fewer and more significant ones. Note that a swing is only confirmed after the candles on its right have closed, so it is always known with a delay.

## Trends: higher highs and lower lows

An **uptrend** is a sequence of higher highs and higher lows: each rally goes further than the last and each pullback stops above the previous low. A **downtrend** is the reverse, with lower highs and lower lows. These definitions are simple on purpose, because a rule you can state precisely is a rule you can test.

*Figure: A zigzag uptrend with its higher highs and higher lows labelled, followed by a sideways range.*

## Ranges and broken structure

When neither side makes progress, highs and lows stay at roughly the same levels. This is a **range**, also called a sideways market or consolidation. It is bounded by a top and a bottom that price keeps returning to.

A trend is considered intact while its structure holds. In an uptrend, the most recent higher low is the line to watch. If price closes below it, the sequence of higher lows is broken. That does not prove a downtrend has begun, only that the uptrend definition no longer holds.

**Worked example: Classifying a sequence of swing points**

1. Price makes a swing high at 1.0900, then a swing low at 1.0850.
2. The next swing high is 1.0930, which is above 1.0900: a higher high (30 pips higher).
3. The next swing low is 1.0875, which is above 1.0850: a higher low (25 pips higher).
4. Another swing high at 1.0960 is above 1.0930, and a swing low at 1.0905 is above 1.0875. Both are higher again.
5. Price then falls to 1.0890, below the last higher low of 1.0905.

Three higher highs and three higher lows describe an uptrend, and the fall to 1.0890 breaks the higher-low sequence by 15 pips (1.0905 - 1.0890).

**Describing market structure.**

| Structure | Highs | Lows |
| --- | --- | --- |
| Uptrend | Higher | Higher |
| Downtrend | Lower | Lower |
| Range | About equal | About equal |

> **Do not call every pause a reversal**
>
> Trends contain pullbacks, and ranges contain false breaks. A single close beyond a level is a piece of evidence, not a verdict, which is why trend rules need to be tested on many trades before they are trusted.

You can express these ideas in a strategy graph. A `SlidingWindow` holds the last N highs, and `Max` returns the highest value in that window and its `Position`. Comparing the current `Close` with such a level with `GreaterThan` is one common way to detect a breakout from a range.

> **Measure structure in a graph**: Combine `SlidingWindow`, `Min` and `Max` to find recent highs and lows, then draw them with `VisualizeLine` to check the levels against the candles. [Open the graph editor](https://quantraider.com/nodesystem)

## Key takeaways

- A swing high or low is a candle that is more extreme than a chosen number of candles on each side, and it is only confirmed with a delay.
- An uptrend is a run of higher highs and higher lows; a downtrend is lower highs and lower lows.
- A range has roughly equal highs and lows, and a trend is in question when price breaks its latest swing low (uptrend) or swing high (downtrend).
- Writing structure as precise rules makes it testable, which is the first step to using it in a strategy.

> Educational content, not financial advice. Trading involves risk of loss.
