Learning objectives
- Timestamp swing confirmation separately from the bar containing the extreme.
- Classify structure using a deterministic tie policy.
Prerequisites: Read high and low sequences and distinguish current from future observations.
Mechanism and interpretation
A swing algorithm turns continuous price variation into selected turning points. Here a two-neighbor swing high requires a bar's high to exceed the highs of two bars before and two bars after it. Its low counterpart reverses the inequalities. The extreme is plotted on the central bar, but the label becomes known only after the second following bar completes. Those are different timestamps.
An up-structure label can require the latest two confirmed highs and latest two confirmed lows to rise. A mixed sequence receives a neutral label instead of forcing a trend. Strict comparison means equal highs do not qualify; an inclusive alternative needs an explicit tie-break. Changing the number of neighbors changes both sensitivity and delay, so apparent precision at the turning point is purchased with later confirmation.
Worked case · synthetic data
Five consecutive highs are 101,103,106,104,102. The middle 106 is a two-neighbor swing high, known only at completion of the fifth bar. If the latest confirmed highs are 105,108 and lows are 98,101, the stated structure is rising. A later low of 97 changes the low sequence and removes the rising-structure condition; it does not erase the earlier correctly timestamped classification.
Failure modes and context
Backtests often buy at a plotted swing low before the confirming bars exist. That uses future information. A trend definition based on closes and one based on wicks may disagree without either being arithmetically wrong. Corporate-action discontinuities and missing bars can create artificial swings. A rising structure describes history and can fail immediately.
Practice assignment
For highs 200,203,207,205,204, state the swing high and confirmation bar. Then replace the final 204 with 208 and re-evaluate. Explain whether a strategy at the third bar could have known the final classification in either sequence.
Worked answer
The first sequence confirms 207 at the fifth bar. In the changed sequence,208 exceeds 207, so the third bar is not a two-neighbor swing high. At the third bar neither outcome was knowable because both following highs were still absent. Use a signal timestamp at or after confirmation in any simulation.
Check your understanding
Question 1
When is a two-neighbor centered swing known?
- Before the central bar
- After two following bars complete
- At the central bar open
Reveal answer and reasoning
B. After two following bars complete
The definition explicitly requires two later observations.
Question 2
What should mixed higher highs and lower lows receive under this rule?
- A neutral or mixed label
- An automatic uptrend
- An automatic low-risk buy
Reveal answer and reasoning
A. A neutral or mixed label
Both rising highs and rising lows are required.
Question 3
Why can a plotted swing create look-ahead?
- All swings are random
- Chart colors change prices
- Its plotted bar precedes its confirmation time
Reveal answer and reasoning
C. Its plotted bar precedes its confirmation time
A historical marker can appear earlier than the information needed to produce it.
