Direct answer: the rules, in testable form
Swing highs and swing lows are points on a price chart that describe local turning behavior: a swing high is a local peak, and a swing low is a local trough. The “rules” for identifying them are mostly about two things: (1) the definition of local, and (2) the data you are using (price type and ordering).
A testable rule set must let you answer, on the same chart, “Is this bar the highest within my defined window?” and “Is it separated enough from earlier/later bars to count as a swing?” If your rules cannot be applied consistently by another person, the output will vary.
Mechanism or definition: inputs and the core swing rule
1) Choose the price series
Before locating swings, pick what “price” means in your method. Common choices include using candle high/low (for swing extremes) or using closes (for smoother signals). Your rule should state the exact series used, for example:
- Swing highs use the bar high value.
- Swing lows use the bar low value.
2) Define what “local” means (the swing window)
Local means “dominates a neighborhood.” A practical way to make this testable is to define a window of bars on both sides.
Example rule (one widely used pattern of logic):
- A bar at index i is a swing high if its high is greater than the highs of a fixed number of bars on the left and a fixed number of bars on the right.
- A bar at index i is a swing low if its low is lower than the lows of a fixed number of bars on the left and a fixed number of bars on the right.
The number of bars in that left/right neighborhood is a parameter. It is not universal; changing it changes the swing points.
3) Require separation (avoid counting tiny wiggles)
To reduce overcounting, you can add a separation rule, such as:
- After identifying a swing high, the next swing low must occur after at least N bars, and vice versa.
This is especially important in choppy ranges, where many bars can satisfy a strict “local maximum” test.
4) Handle ties (equal highs/lows)
Markets can print equal highs or equal lows. Your rules should state a tie-breaker. Options include:
- “Strictly greater/strictly less” (so ties do not count as swings), or
- “Greater than or equal” with an extra tie-breaker (such as earliest/latest bar), or
- Treat equal extremes as a zone and select a representative bar.
Without a tie policy, two readers can reasonably disagree.
5) Determine when a swing is confirmed
Any rule that uses bars on both sides implies the point is confirmed only after the right-side neighborhood has occurred. If you try to label swings in real time, you will have a built-in delay.
A complete ruleset should therefore specify:
- “Swings are confirmed only after k bars after the candidate,” where k is your right-side window.
Evidence or example: applying the rule consistently
Assume a simplified dataset of bars in time order, and use this definition:
- Swing high: bar high at i is strictly greater than the highs of L bars to the left and R bars to the right.
- Swing low: bar low at i is strictly lower than the lows of L bars to the left and R bars to the right.
Now consider a visual check procedure:
- Pick a candidate bar i.
- Count L bars to the left and verify the candidate high is higher than each of those highs.
- Count R bars to the right and verify the candidate high is higher than each of those highs.
- If all comparisons pass, mark it as a swing high; otherwise discard it.
For swing lows, repeat using lows and strict “lower than” comparisons.
Because this method is based on explicit comparisons, another person can replicate the same marks if they use the same parameters (L, R) and the same price series (high/low or close, etc.). That is the key “rule” requirement for verification.
Limitations and risks: what can break the rules
1) Parameter sensitivity
The left/right window size and any separation rules materially affect the swing map. In practice:
- A smaller window finds more swings and may chase noise.
- A larger window finds fewer swings and may miss smaller turns.
This is a limitation of any local-extremum approach applied to noisy price.
2) Trend compression and false turning points
In strong trends, small pauses can still create local highs/lows even when the broader move is unchanged. Your swings then reflect micro-structure rather than a meaningful regime shift. The rules correctly detect local turning behavior, but the interpretation may not match your assumption.
3) Equal highs/lows and ambiguity
Equal extremes create ambiguity. If your method does not explicitly define how ties are treated, swing points can shift by one bar when re-annotated.
4) Confirmation delay
If your rule needs right-side bars to confirm the swing, you cannot know a swing high/low at the exact moment the candidate forms. Any attempt to “project” swings before confirmation will be inconsistent with the testable rule definition.
5) Market and execution variability
Even though the swing identification is defined on a chart, the chart itself can differ due to data source, symbol settings, and chart construction (for example, candle aggregation). Therefore, historical swing marks may not transfer unchanged across providers or timeframes. Also, costs and execution conditions are separate from the chart-logic itself; they can change realized outcomes, even if the swing identification is consistent.
Verification or next question: how to check your rule set works
To independently verify your swing rule set, you can run a consistency test:
- Annotate the same historical chart twice using the same parameters and price series.
- Compare how often you agree on swing points.
If agreement is low, your rules likely need clarification (window definition, tie policy, separation, and what counts as the price series). A good next step is to pick a single concrete definition (for example, “strict local maxima/minima with L=R over highs/lows”) and then test how the swing points change when you vary only one parameter.