Market Structure HH, HL, LH and LL
Feb 8, 2025

The Market Structure HH, HL, LH and LL indicator is a comprehensive technical analysis tool designed to automatically identify and label significant swing points to visualize price action trends. By detecting Higher Highs (HH), Higher Lows (HL), Lower Highs (LH), and Lower Lows (LL), it helps traders distinguish between bullish and bearish market phases through a structured ZigZag framework.
Usage
The tool is primarily used to determine the current trend direction and identify potential reversal points. Traders can utilize the automated labels to interpret market conditions:
- Uptrend Identification: Confirmed by a sequence of Higher Highs (HH) and Higher Lows (HL). Traders often look for long entries after an HL is formed.
- Downtrend Identification: Confirmed by a sequence of Lower Lows (LL) and Lower Highs (LH). Traders often look for short entries after an LH is formed.
- Trend Reversals: A shift from an uptrend to a downtrend is signaled when the price fails to make a new HH and instead forms an LH followed by an LL.
- Filtering Noise: Adjust the ZigZag Length to focus on major structural shifts rather than minor price fluctuations.
Details
The indicator utilizes a ZigZag-based algorithm to locate local peaks and troughs over a user-defined lookback period. It maintains an internal record of the most recent price extremes to compare current swing points against previous ones.
- Swing Point Detection: A high is marked when the current price is the highest within the specified period; a low is marked when it is the lowest.
- Market Structure Logic: By comparing the current swing high/low (h0, l0) to the previous ones (h1, l1), the script categorizes the market into one of four states, providing objective visual feedback on whether the trend is expanding or contracting.
- Confirmation: The inclusion of a Fib Factor setting allows for optional breakout confirmation, ensuring that the structural shift is significant enough to warrant a new label.
Settings
- ZigZag Length: The number of bars used to determine a new swing high or low. Higher values result in more significant, longer-term structure.
- Show Zigzag: Toggles the visibility of the lines connecting the swing points.
- ZigZag Line Color/Width: Customizes the visual appearance of the structural connections.
- Show HH, HL, LL, LH Labels: Toggles the text labels for market structure points.
- Fib Factor for breakout confirmation: A threshold value used to filter out minor breaches of previous highs or lows.
- Text Size: Adjusts the size of the on-chart labels.
FAQ
How do I access the Market Structure HH, HL, LH and LL indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Can this indicator be used for scalping?
Yes, by lowering the ZigZag Length, the indicator becomes more sensitive to short-term price movements, making it suitable for lower timeframes.
Does the indicator repaint?
Like most ZigZag-based indicators, labels are confirmed once a new trend direction is established. The labels appear at the swing points identified by the lookback length.
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.