Pivot Market Structure
Jan 8, 2025

The Pivot Market Structure indicator tracks market trends and identifies potential reversal zones by combining pivot point calculations with a responsive price action trail.
Usage
The tool is designed to help traders visualize market structure through two primary components:
- Pivot Point Structure: The indicator identifies significant highs and lows based on the surrounding price action. These levels serve as historical points of interest and can be used to identify trend exhaustion or potential breakout levels.
- Price Action Trail: This component uses a trail mechanism to compare current price movements against recent extremes. It is designed to be more responsive than standard pivot points, allowing traders to see internal shifts in market structure more quickly.
- Visual Context: Users can enable features like "Extend Left" to see the full historical reach of a pivot level or use "Line Break" to stop drawing levels once the price has breached them.
Details
The indicator operates on two core logic systems:
- Pivot Logic: Calculates highs and lows where a candle is flanked by a specified number of lower highs or higher lows. These are plotted as circles to denote structural extremes.
- Trail Logic: Uses a "Step Size" to compare the current close against the highest/lowest values of a previous window. This creates a dynamic boundary that tracks price extremes since the last significant structural event. Unlike static pivots, the trail adjusts as new local extremes are formed, providing a more fluid representation of current market momentum.
Settings
Source
- Source: Determines the input price (e.g., Close) used for calculations when high/low values are not selected.
- Use High/Low values instead of source: When enabled, the script uses the actual high and low of the candles for pivot and trail calculations instead of a single source point.
High Low Trail
- Step Size: Sets the number of bars used to compare the current price against historical extremes to determine if a structural break has occurred.
- Length: The lookback period used to find the highest high or lowest low since the last detected event.
- Filling: Enables a gradient background fill between the price and the trail boundaries.
Pivot
- Pivot Length: Defines the number of bars required on each side of a high/low to confirm it as a pivot point.
- Show Pivot Points: Toggles the visibility of the primary pivot point shapes on the chart.
- Extend Left: Extends the horizontal level lines back to the bar where the pivot was originally formed.
- Line Break: If enabled, the horizontal pivot lines will stop plotting once the price closes beyond them.
FAQ
How do I use the Pivot Market Structure indicator?
You can use it to identify support and resistance zones based on pivots or to track momentum shifts using the trailing lines. Breaks above the upper trail or below the lower trail often indicate shifts in the immediate market structure.
What is the difference between the Pivot Points and the Trail?
Pivot points are calculated based on a fixed window of bars to find local peaks and troughs, while the trail is a more dynamic calculation that tracks the highest/lowest prices since the last breach, providing a more continuous view of trend development.
How can I access this script?
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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.