Structure Supply and Demand
Jul 20, 2022

The Structure Supply and Demand indicator identifies and visualizes key institutional supply and demand zones based on classic market structure patterns to help traders pinpoint potential reversal or continuation areas.
Usage
The Usage section highlights how to interpret the four primary patterns detected by the script:
- Rally Base Rally (RBR): A demand zone formed during an uptrend, signaling potential trend continuation.
- Drop Base Rally (DBR): A demand zone formed after a downtrend, signaling a potential bullish reversal.
- Drop Base Drop (DBD): A supply zone formed during a downtrend, signaling potential trend continuation.
- Rally Base Drop (RBD): A supply zone formed after an uptrend, signaling a potential bearish reversal.
Traders can use these zones to set entries, stop losses, or take-profit targets. For example, a trader might look for a long entry when the price retraces into an RBR or DBR zone. The boxes are drawn using the high and low of the final candle in the "base" phase immediately preceding the expansion move.
Details
The script classifies candles into "Big Bars" (expansion) and "Small Bars" (base) based on their body-to-range ratio.
- Expansion: A large directional candle that breaks out of a range.
- Base: A period of consolidation consisting of 1 to 5 candles. The logic ensures that a zone is only confirmed when a "Big Bar" follows a "Base" phase. The script accounts for different base types, including "Inside Bars" and candles with limited extension, to ensure the structural integrity of the identified zone.
Settings
- Big Bar Body Size: The minimum percentage of the total candle range (high to low) that the body must occupy to be considered an expansion candle.
- Small Bar Body Size: The maximum percentage of the candle range the body can occupy to be classified as a base candle.
- Box Width: Determines how many bars into the future the supply/demand box will be drawn.
- Pattern Toggles (RBR, DBD, DBR, RBD): Allows users to enable or disable specific pattern detections.
- Enable Labels: Displays text labels (e.g., "RBR", "DBD") on the chart when a pattern is identified.
- Extend Boxes Right: When enabled, the zones will extend indefinitely to the right of the chart until manually changed.
FAQ
How do I access Structure Supply and Demand?
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 a Supply and a Demand zone in this script?
Demand zones (RBR/DBR) are colored green and represent areas where buying interest is historically strong. Supply zones (DBD/RBD) are colored red and represent areas where selling pressure is high.
Can I adjust the sensitivity of the zone detection?
Yes, by modifying the "Big Bar" and "Small Bar" body size percentages in the settings, you can filter for more aggressive expansions or tighter consolidation bases.
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.