Market Structure HH HL / LL LH
Feb 8, 2026

The Market Structure HH HL / LL LH tool identifies and labels pivot-based swing points to help traders visualize the current trend direction and structural shifts in the market.
Usage
The Market Structure HH HL / LL LH indicator is primarily used to identify the sequence of highs and lows that define a market trend. By labeling Higher Highs (HH), Lower Highs (LH), Higher Lows (HL), and Lower Lows (LL), traders can more easily determine if a market is in an uptrend, downtrend, or transition phase.
- Uptrend Identification: Look for a sequence of HHs and HLs.
- Downtrend Identification: Look for a sequence of LHs and LLs.
- Trend Reversals: A break in the sequence, such as a Lower Low following a series of Higher Lows, often signals a potential change in market structure.
Users can toggle individual labels on or off to focus on specific structural elements and enable connecting lines to visualize the path between consecutive swing points.
Details
The script utilizes the ta.pivothigh and ta.pivotlow functions to detect swing points. A swing point is confirmed when a high or low is the highest or lowest value within a specific lookback and lookforward period (defined by the Swing Length).
Because the indicator requires a lookforward period to confirm a pivot, labels and lines appear with a delay equal to the "Swing Length" setting. This ensures that the identified point is a genuine structural pivot and not a temporary price fluctuation. The logic alternates between high and low detection to maintain a clean zig-zag style sequence of market structure.
Settings
- Swing Length: Determines the number of bars required on each side of a high or low to confirm it as a swing point. Higher values result in more significant, long-term structural points, while lower values capture minor fluctuations.
- Show HH: Toggles the visibility of Higher High labels.
- Show LH: Toggles the visibility of Lower High labels.
- Show HL: Toggles the visibility of Higher Low labels.
- Show LL: Toggles the visibility of Lower Low labels.
- Show Lines: Enables or disables the drawing of lines connecting consecutive swing highs or consecutive swing lows.
FAQ
How can I access Market Structure HH HL / LL LH?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Why do the labels appear several bars late?
The indicator uses pivot logic which requires price action to develop after the high or low to confirm it is a structural point. The delay is exactly equal to the "Swing Length" setting.
Can I use this for multi-timeframe analysis?
Yes, you can apply the indicator to any timeframe. Many traders use a higher Swing Length on lower timeframes or simply apply the indicator to higher timeframe charts to identify the dominant trend before looking for entries on lower timeframes.
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.