Supply and demand
Oct 22, 2024

The Supply and Demand indicator identifies and visualizes significant market zones based on price reaction strength and trend alignment, helping traders find unmitigated, retested, and flipped zones.
Usage
This tool automatically plots supply and demand zones when price exhibits a significant move over a defined period. It distinguishes between fresh (unmitigated) zones and those that have been proven through retests or "break and retest" scenarios.
- Unmitigated Zones: These are the most prominent (highest opacity) and represent fresh areas where price has not yet returned.
- Retested Zones: Shown with medium opacity, these indicate zones where price has returned and reacted, confirming their validity.
- Broken and Retested (Flipped): Displayed with the lowest opacity, these show zones that have "flipped" from supply to demand (or vice-versa) after a break and subsequent retest.
A zone is invalidated and removed if it is broken twice, ensuring only relevant levels remain on the chart.
Details
The script creates zones based on a "Reaction" logic: price must travel a minimum distance (Minimum Range) within a specific number of bars (Reaction Bars). The Minimum Range is calculated using an ATR factor to ensure it scales with market volatility.
The indicator also incorporates a trend filter to ensure zones are created in alignment with market direction. For example, demand zones are only plotted if the trend is considered bullish based on the user-selected SMA criteria.
Settings
- Minimum Range (ATR factor): The distance price must travel for a zone to be considered significant, based on a 14-period ATR.
- Reaction bars: The maximum number of bars allowed for price to travel the required distance.
- Supply/Demand Colors: Customizable colors for bullish (demand) and bearish (supply) zones.
- Limit (ATR factor): A proximity filter that hides zones too far from the current price. Set to 0 to disable.
- Pierced: When enabled, zones are invalidated if a price wick penetrates them (piercing).
- Trend Detection: Choose between "SMA50", "SMA50, SMA200", or "No detection" to filter zone creation based on the moving average trend.
- Stop: Allows users to set a specific time to stop calculations, useful for backtesting the historical effectiveness of zones.
FAQ
How do I interpret the different transparency levels? The clearest (most opaque) zones are unmitigated. Medium transparency indicates a retest has occurred. The most transparent zones represent a "break and retest" flip.
What causes a zone to disappear? Zones are removed if they are broken twice, or if the "Pierced" setting is active and a wick crosses the zone boundary.
How do I access Supply and demand? 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.