Swing trading guide

Swing High and Swing Low Trading: Rules for Market Structure

Short answer

A swing high is a local peak with lower highs on both sides, and a swing low is a local trough with higher lows on both sides. Traders use the sequence of confirmed points to describe structure: higher highs and higher lows suggest an uptrend, while lower highs and lower lows suggest a downtrend. The right-side bars mean a pivot is confirmed only after a delay, so it must not be treated as information that was known on the pivot bar.

Build and Test Swing Structure Rules

The concepts that define the setup

Confirmed swing high

A local high becomes confirmed only after the chosen number of later bars have lower highs. A five-left, five-right pivot is known five bars after the peak, not on the peak bar.

Confirmed swing low

A local low becomes confirmed only after the chosen number of later bars have higher lows. Wider pivot settings identify fewer, larger turns and add more confirmation delay.

Uptrend structure

A sequence of higher confirmed swing highs and higher confirmed swing lows describes rising structure. It does not prove that the next swing will also be higher.

Downtrend structure

A sequence of lower confirmed swing lows and lower confirmed swing highs describes falling structure. A break above the latest lower high can be tested as a change condition, not as a guaranteed reversal.

Range structure

Alternating pivots that fail to extend in either direction can describe a range. Breakout rules should define whether a wick or a completed close is required beyond the boundary.

A rule sequence you can inspect

  1. 1

    1. Fix the pivot width

    Choose the same number of bars on the left and right, such as five and five, before reviewing results.

    A fixed definition prevents discretionary relabeling and makes the confirmation delay explicit.

  2. 2

    2. Store confirmed pivots in sequence

    Record each confirmed high and low, its price, its original bar, and the later bar on which confirmation became available.

    Keeping both timestamps prevents a backtest from acting on a pivot before the strategy could know it existed.

  3. 3

    3. Classify the structure

    Compare the latest two confirmed highs and latest two confirmed lows to label higher, lower, or equal structure.

    The labels turn a visual chart reading into conditions that can be audited across many trades.

  4. 4

    4. Define the trigger

    Require a completed bar to close beyond a confirmed swing level, or define a pullback that holds the most recent swing low or high.

    An exact close rule distinguishes a tested breakout from an intrabar wick or subjective line touch.

  5. 5

    5. Define invalidation and size

    State which confirmed swing invalidates the setup, then size the hypothetical position from that distance before recording an entry.

    Structure identifies a logical failure point, but the distance may still be too large for the account risk limit.

Risks to check before testing

Swing trading risk checks
RiskWhat to check
Lookahead biasConfirm that orders occur only after the right-side bars have closed. A back-plotted pivot marker must not create an order on the earlier pivot bar.
Repainting or moving labelsCompare historical and realtime behavior, use confirmed bars, and document whether any marker can disappear or relocate.
False structure breaksTest wick-through and close-through definitions separately. Record gaps that open beyond the planned entry or stop level.
Parameter sensitivityCompare nearby pivot widths such as three, five, and seven bars. A rule that works only at one exact width may be overfit.
Timeframe mismatchLabel each pivot timeframe explicitly and do not compare a daily swing level with an unlabeled intraday point.

Test templates you can audit

These templates define a research process. They are not trade calls or evidence that a setup will make money.

SPY

1D

Rule to test

Identify five-left, five-right confirmed pivots. Enter a hypothetical long only after a daily close above the latest confirmed swing high while the latest confirmed swing low is higher than the prior swing low.

Execute no earlier than the confirmation bar. Compare pivot widths of three, five, and seven, include gaps and costs, and report drawdown plus trade count alongside returns.

QQQ

4H

Rule to test

After two lower confirmed swing highs, mark a structure-change candidate when a completed 4-hour bar closes above the latest swing high. Invalidate below the latest confirmed swing low.

Compare close confirmation with wick-through entry as separate tests. Split results into trending and range-bound samples and keep the session definition fixed.

AAPL

1D context, 4H trigger

Rule to test

Require rising daily confirmed swing lows. On the 4-hour chart, trigger only after a completed bar closes above its latest confirmed five-bar swing high.

Store daily and 4-hour pivots separately. Use an out-of-sample period and review earnings gaps, slippage, maximum adverse excursion, and parameter sensitivity.

Checks to run before trusting the result

Use one pivot definition for the entire SPY test. Changing from three bars to five bars after seeing the chart makes the result hard to trust.

Wait for the right-side confirmation bars before labeling an AAPL swing point. Plotting the label back on the pivot candle is useful visually, but a strategy could not act there with confirmed information.

For QQQ breakout tests, require a close beyond the confirmed swing level. Record a brief wick through the level separately to measure false breaks.

Keep daily structure and 4-hour execution in separate variables. Mixing pivots from two timeframes without labels makes entries and invalidation rules ambiguous.

Turn the idea into an inspectable rule

Pineify can convert a pivot definition, structure sequence, entry trigger, and invalidation rule into Pine Script. You can then test how pivot width and confirmation delay change trade frequency and drawdown without pretending that a plotted swing point was known early.

Build and Test Swing Structure Rules

Frequently asked questions

Sources and limits

Sources checked 2026-07-18

  • Pivot Points High Low (TradingView, checked 2026-07-18). Defines pivot highs from lower highs on both sides and pivot lows from higher lows on both sides.
  • Visuals FAQ (TradingView Pine Script documentation, checked 2026-07-18). Documents that ta.pivothigh() and ta.pivotlow() confirm only after the specified right-side bars and are plotted with an offset.
  • Operators (TradingView Pine Script documentation, checked 2026-07-18). Provides an official pivot example in which a five-bar right strength causes detection five bars after the pivot occurs.
  • Repainting (TradingView Pine Script documentation, checked 2026-07-18). Explains differences between historical and realtime calculations and identifies back-plotted or relocated events as a risk to audit.

Pineify is an information tool, not investment advice. Swing points and market structure labels are descriptive research tools, not predictions or promises of returns. AI cannot reliably predict future prices. Pivot confirmation is delayed, overnight gaps can bypass planned levels, and trading can result in substantial losses. Simulated and backtested results have limitations and do not guarantee future performance. Verify the implementation and consider advice from a qualified financial professional.