PROTECTED SOURCE SCRIPT
HTF Supply & Demand Zones

📊 Overview
Advanced supply and demand zone indicator that automatically detects institutional-level price zones on higher timeframes and dynamically adapts zone colors based on price position. Zones below price act as demand (support) and zones above price act as supply (resistance).
✨ Key Features
🎯 Dynamic Zone Recognition
- Smart Color Adaptation: Zones automatically change from demand (green) to supply (red) when price crosses them
- Higher Timeframe Analysis: Detect zones from any timeframe while trading on lower timeframes
- Base/Blast Pattern Detection**: Identifies strong institutional zones using base-blast candle methodology
- Automatic Zone Flipping: Broken demand zones become supply and vice versa
📈 Zone Detection Method
Uses the proven Base & Blast candle pattern:
- Base Candle: Small consolidation candle with minimal wick
- Blast Candle: Strong momentum candle breaking from the base
- Customizable Ratio: Adjust base/blast body size ratio (default 8:1)
- Wick Filter: Ensures clean base candles for higher probability zones
🎨 Visual Features
- Clean Zone Boxes: Extended zones with customizable colors and transparency
- Smart Labels: Display zone type and touch count
- Touch Counter: Track how many times price has tested each zone
- Info Dashboard: Real-time statistics in top-right corner
⚙️ Zone Management
- Auto-Delete After X Touches**: Remove zones after specified number of tests (default: 5)
- Optional Break Deletion**: Choose whether to delete zones when price breaks through
- Maximum Zone Limit**: Control chart cleanliness by limiting displayed zones
- Extended Zones**: All zones extend to the right for forward visibility
🔧 Settings
Detection Parameters
- Higher Timeframe: Select any timeframe for zone detection (empty = current timeframe)
- Base/Blast Ratio: 4.0 to 30.0 (default: 8.0) - Higher = stronger zones, fewer signals
- Wick Threshold: 0.1 to 0.5 (default: 0.3) - Maximum base candle wick size
Display Options
- Toggle demand/supply zones independently
- Maximum zones to display (1-50)
- Show/hide zone labels
- Customizable colors for demand and supply zones
- Adjustable border width
Zone Management
- Delete after X touches (1-30 touches)
- Delete on break option
- Touch counter displays current/max touches
💡 How to Use
For Swing Trading
1. Set timeframe to Daily or Weekly
2. Use 8:1 ratio for high-quality zones
3. Enable auto-delete after 3-5 touches
4. Trade pullbacks to green zones (demand) for longs
5. Trade rallies to red zones (supply) for shorts
For Day Trading
1. Set timeframe to 1H or 4H
2. Use 6:1 ratio for more zones
3. Watch for zone color changes as confirmation
4. Enter when price retests zones in the direction of the higher timeframe trend
For Scalping
1. Set timeframe to 15m or 1H
2. Use 5:1 ratio for frequent signals
3. Focus on first touch of fresh zones
4. Use lower timeframes for precise entries
📋 Best Practices
✅ DO:
- Use zones from higher timeframes for better reliability
- Wait for zone color change as confirmation of flip
- Focus on first 2-3 touches of a zone
- Combine with trend analysis
- Use zones as targets and entry levels
❌ DON'T:
- Trade every zone - quality over quantity
- Ignore the touch counter
- Use on very low timeframes without HTF context
- Trade zones that have been tested many times
🎓 Understanding Dynamic Colors
Green Zones (Demand) = Below current price = Support = Look for bounces
Red Zones (Supply) = Above current price = Resistance = Look for rejections
When price breaks a green zone downward, it flips to red (former support becomes resistance)
When price breaks a red zone upward, it flips to green (former resistance becomes support)
📊 Info Dashboard
The top-right table displays:
- Active timeframe
- Current demand zones count (below price)
- Current supply zones count (above price)
- Active base/blast ratio
- Maximum touches setting
🔔 Trading Signals
High Probability Setups:
- Fresh zones (0-1 touches) on higher timeframes
- Zones that align with major support/resistance
- First test after a zone color flip
- Multiple timeframe confluence
Avoid:
- Zones with 4+ touches
- Zones in choppy/ranging markets
- Counter-trend zones during strong momentum
⚡ Performance Notes
- Maximum 500 boxes and lines supported
- Optimized for real-time scanning
- Minimal resource usage
- No repainting - all zones are confirmed
🎯 Recommended Settings by Trading Style
Conservative (Higher Quality)
- Ratio: 10:1
- Wick Threshold: 0.2
- Delete After: 3 touches
Balanced (Default)
- Ratio: 8:1
- Wick Threshold: 0.3
- Delete After: 5 touches
Aggressive (More Signals)
- Ratio: 6:1
- Wick Threshold: 0.4
- Delete After: 7 touches
---
📖 Additional Resources
For more information on supply and demand trading:
- Study institutional order flow
- Learn base and blast candle patterns
- Understand market structure and liquidity zones
- Practice on demo before live trading
Risk Warning: This indicator is a tool for technical analysis. Always use proper risk management and combine with your trading strategy. Past performance does not guarantee future results.
---
Compatible with all markets: Forex, Stocks, Crypto, Futures, and Indices
Version: 1.0 | Language: Pine Script v5
Advanced supply and demand zone indicator that automatically detects institutional-level price zones on higher timeframes and dynamically adapts zone colors based on price position. Zones below price act as demand (support) and zones above price act as supply (resistance).
✨ Key Features
🎯 Dynamic Zone Recognition
- Smart Color Adaptation: Zones automatically change from demand (green) to supply (red) when price crosses them
- Higher Timeframe Analysis: Detect zones from any timeframe while trading on lower timeframes
- Base/Blast Pattern Detection**: Identifies strong institutional zones using base-blast candle methodology
- Automatic Zone Flipping: Broken demand zones become supply and vice versa
📈 Zone Detection Method
Uses the proven Base & Blast candle pattern:
- Base Candle: Small consolidation candle with minimal wick
- Blast Candle: Strong momentum candle breaking from the base
- Customizable Ratio: Adjust base/blast body size ratio (default 8:1)
- Wick Filter: Ensures clean base candles for higher probability zones
🎨 Visual Features
- Clean Zone Boxes: Extended zones with customizable colors and transparency
- Smart Labels: Display zone type and touch count
- Touch Counter: Track how many times price has tested each zone
- Info Dashboard: Real-time statistics in top-right corner
⚙️ Zone Management
- Auto-Delete After X Touches**: Remove zones after specified number of tests (default: 5)
- Optional Break Deletion**: Choose whether to delete zones when price breaks through
- Maximum Zone Limit**: Control chart cleanliness by limiting displayed zones
- Extended Zones**: All zones extend to the right for forward visibility
🔧 Settings
Detection Parameters
- Higher Timeframe: Select any timeframe for zone detection (empty = current timeframe)
- Base/Blast Ratio: 4.0 to 30.0 (default: 8.0) - Higher = stronger zones, fewer signals
- Wick Threshold: 0.1 to 0.5 (default: 0.3) - Maximum base candle wick size
Display Options
- Toggle demand/supply zones independently
- Maximum zones to display (1-50)
- Show/hide zone labels
- Customizable colors for demand and supply zones
- Adjustable border width
Zone Management
- Delete after X touches (1-30 touches)
- Delete on break option
- Touch counter displays current/max touches
💡 How to Use
For Swing Trading
1. Set timeframe to Daily or Weekly
2. Use 8:1 ratio for high-quality zones
3. Enable auto-delete after 3-5 touches
4. Trade pullbacks to green zones (demand) for longs
5. Trade rallies to red zones (supply) for shorts
For Day Trading
1. Set timeframe to 1H or 4H
2. Use 6:1 ratio for more zones
3. Watch for zone color changes as confirmation
4. Enter when price retests zones in the direction of the higher timeframe trend
For Scalping
1. Set timeframe to 15m or 1H
2. Use 5:1 ratio for frequent signals
3. Focus on first touch of fresh zones
4. Use lower timeframes for precise entries
📋 Best Practices
✅ DO:
- Use zones from higher timeframes for better reliability
- Wait for zone color change as confirmation of flip
- Focus on first 2-3 touches of a zone
- Combine with trend analysis
- Use zones as targets and entry levels
❌ DON'T:
- Trade every zone - quality over quantity
- Ignore the touch counter
- Use on very low timeframes without HTF context
- Trade zones that have been tested many times
🎓 Understanding Dynamic Colors
Green Zones (Demand) = Below current price = Support = Look for bounces
Red Zones (Supply) = Above current price = Resistance = Look for rejections
When price breaks a green zone downward, it flips to red (former support becomes resistance)
When price breaks a red zone upward, it flips to green (former resistance becomes support)
📊 Info Dashboard
The top-right table displays:
- Active timeframe
- Current demand zones count (below price)
- Current supply zones count (above price)
- Active base/blast ratio
- Maximum touches setting
🔔 Trading Signals
High Probability Setups:
- Fresh zones (0-1 touches) on higher timeframes
- Zones that align with major support/resistance
- First test after a zone color flip
- Multiple timeframe confluence
Avoid:
- Zones with 4+ touches
- Zones in choppy/ranging markets
- Counter-trend zones during strong momentum
⚡ Performance Notes
- Maximum 500 boxes and lines supported
- Optimized for real-time scanning
- Minimal resource usage
- No repainting - all zones are confirmed
🎯 Recommended Settings by Trading Style
Conservative (Higher Quality)
- Ratio: 10:1
- Wick Threshold: 0.2
- Delete After: 3 touches
Balanced (Default)
- Ratio: 8:1
- Wick Threshold: 0.3
- Delete After: 5 touches
Aggressive (More Signals)
- Ratio: 6:1
- Wick Threshold: 0.4
- Delete After: 7 touches
---
📖 Additional Resources
For more information on supply and demand trading:
- Study institutional order flow
- Learn base and blast candle patterns
- Understand market structure and liquidity zones
- Practice on demo before live trading
Risk Warning: This indicator is a tool for technical analysis. Always use proper risk management and combine with your trading strategy. Past performance does not guarantee future results.
---
Compatible with all markets: Forex, Stocks, Crypto, Futures, and Indices
Version: 1.0 | Language: Pine Script v5
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用它,没有任何限制 — 在此处了解更多信息。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用它,没有任何限制 — 在此处了解更多信息。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。