All indicators

Market Structure Patterns

Jun 27, 2022

Static chart image
Price Action BasedSupport and ResistancePatternsPivot Based (Retrospective)

The Market Structure Patterns indicator provides an automated framework for identifying price action structures, allowing users to track higher highs (HH), higher lows (HL), lower highs (LH), and lower lows (LL) with customizable pattern recognition. By defining specific sequences of market pivots, traders can filter for up to 14 unique price action signatures that match their specific trading strategy.

Usage

The indicator identifies pivot points and connects them to visualize the underlying market trend. Users can leverage this tool to spot trend reversals or continuations through automated labeling and pattern matching.

  • Market Structure Labeling: The script automatically plots HH, HL, LH, and LL labels based on price action relative to previous pivots.
  • Custom Pattern Matching: You can input custom sequences (e.g., 'LL,LH,LL,HH,HL') to identify specific market behaviors like a "Break of Structure" or "Change of Character."
  • Zigzag Visualization: An optional zigzag line can be enabled to highlight the path of price between established pivots.
  • BOS Lines: Enable Break of Structure lines to visualize when price breaches significant previous pivot levels.

Details

The indicator utilizes a pivot-point logic based on a user-defined lookback period (Pivot Strength) to determine local maxima and minima. Unlike standard zigzag indicators, this tool tracks a sequence of these pivots in an array, comparing current values against historical ones to classify the structure.

Note that because the script identifies pivots based on "left + right" bars, the labels are updated in real-time as the required number of bars to the right of a pivot are confirmed.

Settings

General Settings

  • Pivot strength: Determines the number of bars required on either side of a high or low to confirm a pivot point.
  • Show Zigzag: Toggles the visibility of the lines connecting pivot points.
  • Show BOS Lines: Toggles the visibility of horizontal lines indicating a Break of Structure.
  • Show HH/LL: Toggles the text labels for market structure points.
  • Show Pattern Matches: Toggles the display of labels when a custom defined pattern is detected.

Pattern Settings (Bullish & Bearish)

  • Bull 1-7 / Bear 1-7: Input fields where you define the sequence of pivots (e.g., HH, HL) to scan for.
  • Custom Text: The label text that will appear on the chart when the specific sequence is matched.
  • Enable Toggle: A checkbox to enable or disable specific pattern detection.

Styles

  • Colors: Customize the colors for upward (bullish) and downward (bearish) structure points and labels.
  • Line Styles: Adjust the width and style (Dashed or Dotted) of the Zigzag lines.

FAQ

How do I define a custom pattern? In the pattern settings, enter the pivot codes (HH, HL, LH, LL) separated by commas. For example, a basic bullish reversal might be entered as "LL,LH,HL" to represent a sequence of a lower low, followed by a lower high, then a higher low.

Why do labels sometimes appear a few bars late? The indicator uses a "Pivot Strength" setting. If the strength is set to 5, the script must wait for 5 bars to close to ensure the high or low point is not exceeded, confirming it as a valid pivot.

How can I access this tool? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.