Skip to content
All library documents

Swing-Structure Trend Detection with Higher Highs and Lower Lows

Article Strategy library · Author: RiaanGloy

Summary

This document presents a market-structure trading script that detects swing highs and lows with pivot calculations, then classifies direction using comparisons between successive swings. Higher highs and higher lows support an uptrend reading; lower highs and lower lows support a downtrend reading. The visible inputs include swing length and a minimum swing size, along with options for drawing structure lines, labels, entry zones, and stop lines.

The excerpt shows the setup and early trend logic, but cuts off before the entry, exit, and risk-management rules are visible. It therefore does not establish how the displayed entry zones or stops are calculated, nor whether signals are confirmed before execution. No instrument, test period, or performance results are provided. Pivot methods also inherently need later bars to confirm turning points, so a usable evaluation would need to account for confirmation delay and avoid treating retrospectively identified pivots as immediately known.

Key ideas

  • The script identifies candidate swing highs and lows with a configurable pivot length.
  • Successive higher highs or higher lows indicate an uptrend, while lower highs or lower lows indicate a downtrend.
  • The visible settings include controls for visual structure markers and entry-zone displays.
  • The excerpt ends before trade execution and exit rules, so the full strategy cannot be assessed.
  • Pivot confirmation delay should be considered when evaluating signals in historical data.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.