Order Blocks
Oct 24, 2021

The Order Blocks indicator automates the identification of supply and demand zones by detecting market structure breaks (MSB) through the analysis of higher-order pivots. This tool helps traders pinpoint institutional interest areas where liquidity was generated prior to a significant price move.
Usage
The indicator can be used to identify potential reversal or continuation zones based on the following visual elements:
- Demand/Supply Boxes: These boxes highlight the candles that created liquidity for the move that broke the structure. A bullish box (demand) is formed when price breaks above the high that created the most recent lower low. A bearish box (supply) is formed when price breaks below the low that created the most recent higher high.
- Market Structure Break (MSB) Lines: Horizontal lines plot at the specific price level where the structure was broken, providing a clear reference for the breakout point.
- Breakout Candles: Candles that trigger the structure break can be highlighted in a specific color (default is light blue) to easily identify the moment of momentum shift.
- Tested & Filled Zones: Boxes can automatically dim when price re-enters them (tested) or stop extending once price moves entirely through them (filled), helping traders focus on "fresh" zones.
Details
The script utilizes a hierarchical pivot system to determine market direction. It identifies unconfirmed higher-order pivots as Higher Highs (HH) and Lower Lows (LL) to filter out market noise.
- BOS Logic: A bullish break occurs when the price exceeds the "high that created the most recent lower low." Conversely, a bearish break occurs when the price drops below the "low that created the most recent higher high."
- Experimental Higher Order Pivots: The construction relies on concepts from established community methods for identifying structural pivots and order blocks, specifically referencing the work of Rumpypumpydumpy and MarkMiddleton2020.
Settings
- MSB trigger: Determines if a structure break is triggered by price High/Low or Open/Close.
- Display 2nd order pivots: Toggles the visibility of higher-order pivot labels (HH/LL).
- Highlight candles that broke structure: Enables bar coloring for the specific candle that initiates the MSB.
- Plot market structure broke lines: Toggles horizontal lines at the MSB price level.
- Plot demand boxes: Enables or disables the supply/demand zone rectangles.
- Delay to count test of demand box: Number of bars required before a touch of the box is counted as a "test."
- Delay to count fill of demand box: Number of bars required before a full penetration of the box is counted as a "fill."
- Dim tested demand boxes: Changes the visual appearance of zones that have already been mitigated.
- Stop plotting filled demand boxes: Ends the extension of a box once price has completely cleared it.
FAQ
How do I access the Order Blocks indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
What is the difference between "High and Low" and "Close and Open" triggers?
"High and Low" triggers an MSB as soon as price wicks past the structure level, whereas "Close and Open" requires the body of the candle to break the level.
Why do some boxes disappear or change color?
Depending on your settings, boxes will dim when "tested" (price enters the zone) or stop extending when "filled" (price passes through the zone) to keep your chart clean and focused on active order blocks.
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.