Swing Points Node

The Swing Points node finds the highs and lows price turned at, holds the last two of each, and flags higher highs and lower lows. Why every swing arrives a few bars late, and how to use the levels for stops and filters.

NodeBy AlgoLiftUpdated 5 min read
On this page 9How it worksEvery swing is late, by designThe levels and the flagsExample: buy a confirmed higher lowSettingsOutputsUse something else whenWhen it doesn't behaveGoing further

A swing high is a bar whose high stands above its neighbours on both sides: a place where price turned. Traders hang a lot of structure on these points. The stop goes under the last swing low, the trend is read off higher highs and higher lows. The Swing Points node finds them as they confirm, keeps the last two of each kind, and tells you whether each new one printed above or below the one before.

Takes
Nothing. It reads its series' candles
Gives
The last and previous swing highs and lows, higher-high and lower-low flags, and bars since each swing
Reach for it
A stop under the last swing low, or a rule that waits for a higher low

How it works

Two numbers define a swing. Left Strength is how many bars before the pivot must have lower highs, and Right Strength is how many bars after it must have lower highs too. Lows are the mirror image. With the defaults of 5 and 5, a swing high is the highest bar of an 11-bar window with the pivot in the middle.

Every swing is late, by design

Here's the honest part. The node can't know a bar was a swing high until the bars after it have failed to go higher, so a swing is only reported once its Right Strength bars have closed. On ES 5m with Right Strength 5, a high made in the bar that closes at 10:00 is announced when the bar closing at 10:25 has closed, and your strategy can act on it from there.

That isn't a flaw to engineer around. It's what a swing is: a turning point you can only see in hindsight. Any tool that marks one sooner is reading bars it couldn't have seen. If you need the information faster, lower Right Strength and accept the smaller, noisier swings that come with it.

The levels and the flags

Last Swing High and Last Swing Low hold the most recent confirmed swing of each kind and carry it forward until the next one replaces it. Previous holds the one before. Each new swing high also sets one of two flags: Higher High if it's above the last one, Lower High if it's below. Lows work the same way. A new swing exactly equal to the last is neither.

Minimum Move filters out wiggles. A new swing within that many ticks of the last one of its kind is ignored completely: no flag, no new level, no reset of the count. On ES and NQ a tick is 0.25, so 8 ticks is 2 points.

Example: buy a confirmed higher low

You trade ES 5m and want to buy pullbacks, but only once the market has shown its hand with a higher low. The stop goes under that low.

Set Swing Points to Left and Right Strength 3 (a 15-minute wait for confirmation) and Minimum Move 8 ticks. Wire Higher Low into a Logic AND, together with a Comparison checking that Current Price is above an EMA 50, and send the AND into a long Entry. Higher Low is true for the one bar after the new low confirms, so that bar is the entry's only chance.

For the stop, measure the Bracket Order's stop from a level: wire Last Swing Low into the stop's level input and set the distance to 1 point. At that moment Last Swing Low is the higher low that fired the entry, and the level is read once, when the trade fills, so the stop stays put if a newer swing confirms later.

Settings

Left Strength
Default 5
Bars before the pivot that must stay under it (for a high) or over it (for a low).
Right Strength
Default 5
Bars after the pivot that must confirm it. It's also how many bars late every swing arrives.
Allow Equal Bars
Default Off
Off, a neighbour with the same high or low cancels the pivot. On, equal highs and lows confirm as swings.
Minimum Move
Default 0 (every swing)
Ignore a swing within this many ticks of the last one of its kind.

Outputs

Is Swing High / Low
True or false
True for one bar, the bar after a swing confirms.
Swing Price
Number
The latest swing of either kind.
Last Swing High / Low
Number
The most recent confirmed swing, held until the next. Empty before the first one.
Previous Swing High / Low
Number
The swing before the last one. With the last, it measures a leg.
Higher High / Lower High
True or false
True for one bar when a new swing high confirms above, or below, the one before.
Higher Low / Lower Low
True or false
The same for swing lows.
Bars Since Swing High / Low
Number
Bars since the last swing confirmed, counted from the confirming bar.

Use something else when

You're reading the trend, or trading a break
The trend, the break of structure and the change of character come from one node that tracks its own swings.
The highest high of the last N bars
A fixed window of completed bars with no confirmation lag. Not a turning point, but often what a breakout rule really means.
Floor-trader pivots
P, R1 and S1 come from the prior period's high, low and close. Same word, a different idea.

When it doesn't behave

Swings show up bars after the turn

That's Right Strength doing its job: a swing is confirmed only once that many bars have closed after it. Lower it for faster swings, knowing you'll get more of them and that they'll mean less.

A double top didn't make a swing high

With Allow Equal Bars off, two bars with exactly the same high cancel each other, so a flat double top can produce no swing at all. Turn the setting on when equal highs are what you're looking for.

The builder won't let me wire Last Swing High into a Crossover

Swing Points keeps its own memory across the engine's monthly chunks of history, so a Crossover (or Since, Capture, a State Machine) can't read its history correctly, and the builder refuses rather than guess. Compare the level with a Comparison instead, which is exact on every bar.

Going further

Equal highs make a good target for this node. The Patterns section of the node panel has one ready: Swing Points with Allow Equal Bars on, and the last two swing highs checked to sit within a point of each other. Traders read that shelf as a pool of resting buy stops, and it pairs naturally with Market Structure's sweep idea on the next page.

Be careful how you pick the strengths. 3 and 3, 5 and 5, and 8 and 8 draw different structures, which means different strategies. Decide which swings you'd mark by hand on a chart before you look at any results. If you sweep them anyway, that's an optimization, and it counts against your search budget like any other.

Or ask the copilot