Indicators

Swing High/Low Detector: Trading Market Structure

How the swing high/low detector finds structural turning points, how bots trade structure breaks, and how to use it in Setup.Cash.

By Setup.Cash TeamLast updated 2026-07-032 min read339 words

Featured image placeholder

/og/setup-cash-og.svg

Before indicators, there was structure: markets move in swings, and the sequence of swing highs and swing lows is the trend. The Swing High/Low Detector automates what price-action traders do by eye — it finds each local turning point and tracks the latest confirmed swing levels as tradeable lines.

How It Works

With a lookback of 3 (the default), a swing high is a bar whose high exceeds the 3 bars on each side; a swing low is the mirror. The indicator maintains:

  • Swing High series: the most recent confirmed swing high level.
  • Swing Low series: the most recent confirmed swing low level.
  • New Swing High / New Swing Low events that fire the moment a new point confirms.

Why Structure Beats Lines on a Chart

  • Uptrend = higher swing highs and higher swing lows.
  • Downtrend = lower highs and lower lows.
  • Break of structure — price closing beyond the last swing level against the trend — is often the earliest objective sign a trend is turning, well before a moving average crosses.

How to Trade It

1. Structure breakout. Go long when price closes above the last swing high; the market has printed a new higher high.

2. Trend-following stops. Trail your stop under each new higher swing low — you stay in until the structure that justified the trade is actually broken.

3. Range definition. The latest swing high and low frame the current range; trade the break or fade the edges depending on your regime filter.

Building It in Setup.Cash

Add the Swing High/Low Detector in the strategy builder and condition on price crossing the Swing High/Low series, or trigger on the New Swing events. It combines naturally with Fractals (a fixed-width version of the same concept) and Support/Resistance Zones, which cluster swings into zones.

Tuning

  • Lookback 3: balanced sensitivity.
  • Smaller (1–2): every minor wiggle counts — scalping structure.
  • Larger (5–10): only significant swings — swing trading structure.

Structure is the skeleton every other signal hangs on. Backtest a structure-break entry against your current entry and compare.

Not financial advice. Trading involves risk. Use backtesting and paper trading before risking real capital.

Related Posts

View all

Start here

Build your trading bot workflow with structure

Use Setup.Cash to create, backtest, and paper trade rule-based strategies without relying on guesswork. Not financial advice. Trading involves risk.