Supply and Demand Based Pattern [RH]
Jun 19, 2023

The Supply and Demand Based Pattern [RH] indicator detects RBR (Rally-Base-Rally) and DBD (Drop-Base-Drop) patterns to identify periods of high momentum and potential trend continuation or reversal.
Usage
The script is primarily used to identify supply and demand continuation structures. Traders can use these patterns to find entries in the direction of the prevailing trend:
- Bullish (RBR): This pattern consists of an initial upward movement (Rally), followed by a consolidation or minor retracement (Base), and then a subsequent upward movement (Rally). A confirmation occurs when price closes above the high of the first rally.
- Bearish (DBD): This pattern consists of a downward movement (Drop), a consolidation (Base), and a subsequent downward movement (Drop). Confirmation occurs when price closes below the low of the first drop.
The indicator highlights these areas with boxes and labels on the chart. Users can set alerts for every pattern detected or only for the first pattern in a specific range to avoid repetitive signals.
Details
The script follows specific logic to ensure the validity of the supply and demand patterns:
- Directionality: Both RBR and DBD share the same logic but in opposite directions.
- Candle Nature: During the "Rally" or "Drop" phases, all candles must be of the same nature (bullish for RBR, bearish for DBD).
- Momentum Requirement: The first phase must contain at least one "healthy" candle—defined by the ratio of the body to the total range—to ensure sufficient momentum is present.
- Retracement Constraint: To maintain the integrity of a continuation pattern, the "Base" phase is not permitted to retrace beyond a specific percentage of the first movement.
Settings
- Candle Health %: Sets the minimum required body-to-range ratio for at least one candle in the initial move. Higher values filter for stronger momentum.
- Base Max Retracement: Determines the maximum allowed retracement of the base relative to the first move. A value of 0.80 means the base cannot retrace more than 80% of the initial rally or drop.
FAQ
How do I use the RBR and DBD labels?
The RBR labels indicate bullish continuation opportunities, while DBD labels indicate bearish continuation opportunities. They appear once the price breaks the high/low of the initial move after a base has formed.
Can I adjust the sensitivity of the patterns?
Yes, by increasing the Candle Health % or decreasing the Base Max Retracement, you can make the indicator stricter, showing only the most impulsive patterns.
How do I access Supply and Demand Based Pattern [RH]?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
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.