Order Blocks
Dec 27, 2024

The Order Blocks indicator tool identifies and highlights institutional supply and demand zones on your chart to help anticipate significant market reversals and trend continuations.
Usage
The Usage section describes how the script can be used to identify high-probability entry and exit zones. Traders can use the highlighted boxes to spot where institutional buying or selling pressure originated.
- Bullish Order Blocks: Represented by green boxes, these zones indicate areas where significant buying occurred. Traders often look for long entries when the price returns to test these levels.
- Bearish Order Blocks: Represented by red boxes, these zones indicate areas where significant selling occurred. These are typically used to identify potential short entries or profit-taking targets.
- Dual Detection: The script uses two independent sensitivity settings (OB1 and OB2), allowing you to track both short-term momentum shifts and longer-term structural order blocks simultaneously.
Details
This script automates the detection of order blocks by scanning for specific price action patterns—specifically, the last opposite-colored candle before a sharp move (displacement).
- Calculation: It calculates the percentage change in price to determine if a move is impulsive enough to qualify as an order block.
- Dynamic Clearing: To maintain a clean chart, the tool automatically removes boxes when the price "breaks" the zone (e.g., a candle closes above a bearish OB or below a bullish OB), signaling that the supply or demand at that level has been exhausted.
- Volume Integration: An optional volume label can be displayed on the blocks to help traders verify the strength of the institutional move.
Settings
OB Visibility
- Show OB1 / Show OB2: Toggles the visibility of the two independent order block detection systems.
- OB Sensitivity: Sets the threshold for detecting a move. A lower value results in more frequent blocks, while a higher value filters for only the most impulsive moves.
OB Appearance
- Bullish/Bearish Colors: Customize the fill and border colors for both bullish and bearish zones.
- Show Volume: When enabled, displays the volume of the candle that formed the order block.
- Text Style/Alignment: Adjust the size and horizontal alignment of the volume labels within the boxes.
FAQ
How do I access Order Blocks?
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 OB1 and OB2?
OB1 and OB2 are two separate instances of the same logic but with different lookback periods and sensitivity settings. This allows you to visualize multiple time-horizon interests on a single chart.
Why do some boxes disappear?
The script includes an automatic clearing feature. If the price closes through the "invalidated" side of the block (the top of a bearish block or the bottom of a bullish block), the zone is considered broken and is removed from the chart.
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.