OPEN-SOURCE SCRIPT
已更新 Supply/Demand Zones + Engulfment-based Execution

Supply/Demand Zones + Engulfment-Based Execution
Strategy Overview
This strategy combines institutional trading concepts—supply/demand zones and engulfing candle patterns—to generate high-probability long and short trade setups. The system uses aggregated price action to identify potential reversal zones and confirms entries with engulfing candle patterns, ensuring trades are only taken when market structure shows commitment in the direction of the trade.
Core Concepts
• Supply & Demand Zones: These are automatically detected by analyzing aggregated bullish and bearish candle structures over user-defined intervals. Supply zones are formed after bearish continuation patterns; demand zones appear after bullish continuation patterns.
• Engulfing Entries: Once price enters a zone, the strategy waits for a bullish engulfing pattern (in a demand zone) or a bearish engulfing pattern (in a supply zone) before executing a trade. This adds confirmation and reduces false signals.
• Risk Management: Stop-loss is placed at the low (for long trades) or high (for short trades) of the engulfed candle. Take-profit can be calculated using a fixed R-multiple (risk-to-reward ratio) or a user-defined target price.
Key Features
[✅] Fully customizable aggregation factor for zone detection
[✅] Visual zone boxes, entry/SL/TP boxes, and engulfing pattern labels
[✅] Optional removal of mitigated zones for cleaner charting
[✅] Configurable trade mode (Long only, Short only, or Both)
[✅] Support for trading sessions and date filtering
[✅] Alerts for price entering supply or demand zones
How to Use
[1] Select Aggregation Factor: Choose how many candles to group together for identifying key zones (e.g., 4x timeframe).
[2] Enable Zones: Turn on supply and/or demand zones as needed.
[3] Set Execution Parameters:
– Choose R-multiple (e.g., 2:1 risk-reward)
– Or use a fixed take-profit price
[4] Define Trade Time Window:
– Set the date and time ranges to restrict execution
– Use Start Hour and End Hour to limit trades to specific sessions (e.g., London/New York)
[5] Run on Desired Timeframe: Typically used on 15m–4H charts, depending on your strategy and the asset’s volatility.
Ideal For
• Traders using Smart Money Concepts (SMC)
• Those who value high-confluence entries
• Intraday to swing traders looking for structure-based automation
⚠️ Important Notes
• The strategy requires engulfing confirmation within the zone to enter a position.
• This script does not repaint and executes trades on a bar close basis.
• Backtest results may vary based on session filters and aggregation factor.
© Attribution
This strategy was developed by The_Forex_Steward and is licensed under the Mozilla Public License 2.0.
You are free to use, modify, and distribute it under the terms of that license.
Strategy Overview
This strategy combines institutional trading concepts—supply/demand zones and engulfing candle patterns—to generate high-probability long and short trade setups. The system uses aggregated price action to identify potential reversal zones and confirms entries with engulfing candle patterns, ensuring trades are only taken when market structure shows commitment in the direction of the trade.
Core Concepts
• Supply & Demand Zones: These are automatically detected by analyzing aggregated bullish and bearish candle structures over user-defined intervals. Supply zones are formed after bearish continuation patterns; demand zones appear after bullish continuation patterns.
• Engulfing Entries: Once price enters a zone, the strategy waits for a bullish engulfing pattern (in a demand zone) or a bearish engulfing pattern (in a supply zone) before executing a trade. This adds confirmation and reduces false signals.
• Risk Management: Stop-loss is placed at the low (for long trades) or high (for short trades) of the engulfed candle. Take-profit can be calculated using a fixed R-multiple (risk-to-reward ratio) or a user-defined target price.
Key Features
[✅] Fully customizable aggregation factor for zone detection
[✅] Visual zone boxes, entry/SL/TP boxes, and engulfing pattern labels
[✅] Optional removal of mitigated zones for cleaner charting
[✅] Configurable trade mode (Long only, Short only, or Both)
[✅] Support for trading sessions and date filtering
[✅] Alerts for price entering supply or demand zones
How to Use
[1] Select Aggregation Factor: Choose how many candles to group together for identifying key zones (e.g., 4x timeframe).
[2] Enable Zones: Turn on supply and/or demand zones as needed.
[3] Set Execution Parameters:
– Choose R-multiple (e.g., 2:1 risk-reward)
– Or use a fixed take-profit price
[4] Define Trade Time Window:
– Set the date and time ranges to restrict execution
– Use Start Hour and End Hour to limit trades to specific sessions (e.g., London/New York)
[5] Run on Desired Timeframe: Typically used on 15m–4H charts, depending on your strategy and the asset’s volatility.
Ideal For
• Traders using Smart Money Concepts (SMC)
• Those who value high-confluence entries
• Intraday to swing traders looking for structure-based automation
⚠️ Important Notes
• The strategy requires engulfing confirmation within the zone to enter a position.
• This script does not repaint and executes trades on a bar close basis.
• Backtest results may vary based on session filters and aggregation factor.
© Attribution
This strategy was developed by The_Forex_Steward and is licensed under the Mozilla Public License 2.0.
You are free to use, modify, and distribute it under the terms of that license.
發行說明
Updated calculation logic for zones發行說明
Updated chart開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。