OPEN-SOURCE SCRIPT
Cập nhật AG Pro Engulfing Candle Quality [AGPro Series]

AG Pro Engulfing Candle Quality [AGPro Series]
Overview / What it does
AG Pro Engulfing Candle Quality is a price action overlay designed to detect bullish and bearish engulfing candles and then grade them through a structured quality framework instead of treating every engulfing event as equally important.
Rather than marking all engulfing candles with the same visual weight, this script evaluates whether the candle shows characteristics that may make the event more meaningful in context. The goal is to reduce low-value pattern noise and help the user focus on engulfing candles that display stronger internal structure and better surrounding conditions.
The script can color qualifying candles, display score labels directly on the chart, add optional background emphasis, and summarize recent signal state through an information panel. This makes it suitable for traders who want a cleaner way to review engulfing behavior without turning the chart into a generic pattern map.
In practical use, the script is not intended to predict direction on its own. It is designed as a filtering and chart-reading aid for users who already work with structure, liquidity, support/resistance, trend context, or discretionary execution rules.
Unique Edge
Many engulfing tools stop at pattern detection. This script takes a different approach by treating engulfing candles as a quality event rather than a binary event.
Its core difference is the scoring model. Each qualifying candle is evaluated through a multi-factor framework that can include relative volume behavior, body-to-range efficiency, prior directional context, engulf strength, and optional support/resistance proximity. This creates a 1-10 quality score that helps separate weaker engulfing events from stronger ones.
The result is a more selective workflow:
- detect the pattern,
- evaluate the candle quality,
- display only the events that meet the user’s threshold,
- and keep the chart focused on higher-interest formations.
This makes the script different from simple engulfing markers, basic candlestick libraries, or broad pattern collections. Its purpose is not to label everything. Its purpose is to rank and filter.
Methodology
The script identifies bullish and bearish engulfing conditions using configurable detection logic. Users can choose a stricter close-based interpretation or a broader wick-based interpretation depending on how selective they want the pattern engine to be.
Once an engulfing candle is detected, the script evaluates the event with a weighted quality framework. The conceptual components include:
1. Relative volume
The candle is compared against a moving average of volume. A candle that forms with stronger-than-normal participation can receive a higher quality contribution than one forming on ordinary or weak activity.
2. Body efficiency
The candle body is evaluated relative to the full range. A larger, more decisive body may indicate stronger commitment than a candle with excessive wick noise and a relatively small real body.
3. Prior directional context
The script reviews recent directional pressure over a user-defined lookback window. This helps distinguish engulfing candles that appear after a more meaningful opposing move from those that form in flatter or less informative conditions.
4. Engulf strength
The script can incorporate how convincingly the current candle overtakes the prior candle structure, adding another layer beyond simple pattern recognition.
5. Optional support/resistance proximity
Users can enable an additional contextual bonus when the engulfing event forms near pivot-derived support or resistance areas.
These components are normalized into a score from 1 to 10. The score is then used for chart display, filtering, and alerts. This means the script is not simply asking whether an engulfing candle exists. It is asking whether the engulfing candle appears to have enough internal and contextual quality to deserve attention.
Signals & Alerts
The script can display:
- bullish engulfing events,
- bearish engulfing events,
- candle coloring for qualified signals,
- optional score labels,
- optional background highlights,
- and a chart panel summarizing recent signal state.
Alerts are deterministic and based on confirmed rule conditions inside the script. Users can create alerts for:
- bullish engulfing events,
- bearish engulfing events,
- high-quality bullish engulfing events,
- high-quality bearish engulfing events,
- or any engulfing event that meets the selected minimum score threshold.
As with any chart tool, users should understand that alerts reflect the script’s rules, not an outcome guarantee. An alert means the selected condition has been satisfied according to the methodology. It does not imply that the next market move will be favorable.
Key Inputs
The script includes several controls so users can adapt the tool to different symbols and timeframes.
Important inputs include:
- minimum score required for display,
- label cooldown to reduce visual clustering,
- trend-strength lookback,
- strict close-based or broader wick-based engulf logic,
- bullish and bearish visibility toggles,
- optional support/resistance bonus,
- support/resistance pivot length,
- ATR-based proximity setting,
- scoring weights for volume, body efficiency, trend context, and engulf strength,
- volume average threshold,
- body/range threshold,
- color controls for bullish, bearish, and score states,
- label size,
- background highlight toggle,
- candle-coloring toggle,
- score label visibility,
- panel visibility, position, font size, and theme,
- and minimum score required for alerts.
These inputs allow the user to keep the script conservative and selective, or make it more permissive when reviewing more active charts.
Limitations & Transparency
This script is a rule-based visual analysis tool. It does not know future price action, and it does not confirm trade quality on its own.
Several points are important:
- An engulfing candle is still a local pattern. It can fail, especially in noisy or low-liquidity environments.
- Strong scores do not guarantee continuation or reversal.
- The support/resistance context is approximate and derived from pivot logic, not from a universal market map.
- Volume behavior can vary across markets and data feeds.
- Different timeframes can produce very different signal density and quality distribution.
- The script is designed for confirmation and filtering, not for fully automated decision-making.
Users should treat the score as a structured quality estimate, not as a promise. In many workflows, the script is most useful when combined with broader context such as market structure, trend bias, higher-timeframe levels, session behavior, or risk management rules.
Risk Disclosure
This script is provided for chart analysis and educational use. It is not financial advice, not an execution system, and not a guarantee of performance.
All trading and investing involve risk. Market conditions can change quickly, and any pattern, score, or alert can fail. Users are responsible for their own analysis, entries, exits, and risk controls.
Use the script as a decision-support tool, not as a substitute for judgment.
Overview / What it does
AG Pro Engulfing Candle Quality is a price action overlay designed to detect bullish and bearish engulfing candles and then grade them through a structured quality framework instead of treating every engulfing event as equally important.
Rather than marking all engulfing candles with the same visual weight, this script evaluates whether the candle shows characteristics that may make the event more meaningful in context. The goal is to reduce low-value pattern noise and help the user focus on engulfing candles that display stronger internal structure and better surrounding conditions.
The script can color qualifying candles, display score labels directly on the chart, add optional background emphasis, and summarize recent signal state through an information panel. This makes it suitable for traders who want a cleaner way to review engulfing behavior without turning the chart into a generic pattern map.
In practical use, the script is not intended to predict direction on its own. It is designed as a filtering and chart-reading aid for users who already work with structure, liquidity, support/resistance, trend context, or discretionary execution rules.
Unique Edge
Many engulfing tools stop at pattern detection. This script takes a different approach by treating engulfing candles as a quality event rather than a binary event.
Its core difference is the scoring model. Each qualifying candle is evaluated through a multi-factor framework that can include relative volume behavior, body-to-range efficiency, prior directional context, engulf strength, and optional support/resistance proximity. This creates a 1-10 quality score that helps separate weaker engulfing events from stronger ones.
The result is a more selective workflow:
- detect the pattern,
- evaluate the candle quality,
- display only the events that meet the user’s threshold,
- and keep the chart focused on higher-interest formations.
This makes the script different from simple engulfing markers, basic candlestick libraries, or broad pattern collections. Its purpose is not to label everything. Its purpose is to rank and filter.
Methodology
The script identifies bullish and bearish engulfing conditions using configurable detection logic. Users can choose a stricter close-based interpretation or a broader wick-based interpretation depending on how selective they want the pattern engine to be.
Once an engulfing candle is detected, the script evaluates the event with a weighted quality framework. The conceptual components include:
1. Relative volume
The candle is compared against a moving average of volume. A candle that forms with stronger-than-normal participation can receive a higher quality contribution than one forming on ordinary or weak activity.
2. Body efficiency
The candle body is evaluated relative to the full range. A larger, more decisive body may indicate stronger commitment than a candle with excessive wick noise and a relatively small real body.
3. Prior directional context
The script reviews recent directional pressure over a user-defined lookback window. This helps distinguish engulfing candles that appear after a more meaningful opposing move from those that form in flatter or less informative conditions.
4. Engulf strength
The script can incorporate how convincingly the current candle overtakes the prior candle structure, adding another layer beyond simple pattern recognition.
5. Optional support/resistance proximity
Users can enable an additional contextual bonus when the engulfing event forms near pivot-derived support or resistance areas.
These components are normalized into a score from 1 to 10. The score is then used for chart display, filtering, and alerts. This means the script is not simply asking whether an engulfing candle exists. It is asking whether the engulfing candle appears to have enough internal and contextual quality to deserve attention.
Signals & Alerts
The script can display:
- bullish engulfing events,
- bearish engulfing events,
- candle coloring for qualified signals,
- optional score labels,
- optional background highlights,
- and a chart panel summarizing recent signal state.
Alerts are deterministic and based on confirmed rule conditions inside the script. Users can create alerts for:
- bullish engulfing events,
- bearish engulfing events,
- high-quality bullish engulfing events,
- high-quality bearish engulfing events,
- or any engulfing event that meets the selected minimum score threshold.
As with any chart tool, users should understand that alerts reflect the script’s rules, not an outcome guarantee. An alert means the selected condition has been satisfied according to the methodology. It does not imply that the next market move will be favorable.
Key Inputs
The script includes several controls so users can adapt the tool to different symbols and timeframes.
Important inputs include:
- minimum score required for display,
- label cooldown to reduce visual clustering,
- trend-strength lookback,
- strict close-based or broader wick-based engulf logic,
- bullish and bearish visibility toggles,
- optional support/resistance bonus,
- support/resistance pivot length,
- ATR-based proximity setting,
- scoring weights for volume, body efficiency, trend context, and engulf strength,
- volume average threshold,
- body/range threshold,
- color controls for bullish, bearish, and score states,
- label size,
- background highlight toggle,
- candle-coloring toggle,
- score label visibility,
- panel visibility, position, font size, and theme,
- and minimum score required for alerts.
These inputs allow the user to keep the script conservative and selective, or make it more permissive when reviewing more active charts.
Limitations & Transparency
This script is a rule-based visual analysis tool. It does not know future price action, and it does not confirm trade quality on its own.
Several points are important:
- An engulfing candle is still a local pattern. It can fail, especially in noisy or low-liquidity environments.
- Strong scores do not guarantee continuation or reversal.
- The support/resistance context is approximate and derived from pivot logic, not from a universal market map.
- Volume behavior can vary across markets and data feeds.
- Different timeframes can produce very different signal density and quality distribution.
- The script is designed for confirmation and filtering, not for fully automated decision-making.
Users should treat the score as a structured quality estimate, not as a promise. In many workflows, the script is most useful when combined with broader context such as market structure, trend bias, higher-timeframe levels, session behavior, or risk management rules.
Risk Disclosure
This script is provided for chart analysis and educational use. It is not financial advice, not an execution system, and not a guarantee of performance.
All trading and investing involve risk. Market conditions can change quickly, and any pattern, score, or alert can fail. Users are responsible for their own analysis, entries, exits, and risk controls.
Use the script as a decision-support tool, not as a substitute for judgment.
Phát hành các Ghi chú
TV-Safe Update Notes — V1.1This update focuses on presentation quality, panel clarity, and cleaner chart usability while preserving the original engulfing quality framework.
What changed in this update:
- Refined the information panel with a cleaner premium layout.
- Reworked the top panel header into a single merged title row for a more consistent AG Pro visual standard.
- Improved panel readability for both dark and light themes.
- Kept panel font sizing compact by default for better chart balance.
- Preserved label sizing flexibility, with a readable default setting for on-chart signal labels.
- Added a Body / ATR context readout to improve immediate candle expansion assessment.
- Improved contextual summary output so recent signal state is easier to interpret at a glance.
- Maintained the core scoring structure based on engulf strength, body quality, volume relationship, trend context, close location, and optional support/resistance proximity.
- Kept signal filtering centered on quality selection rather than raw pattern frequency.
- Improved overall chart presentation so the script remains informative without becoming visually heavy.
Design intent:
- This script is built to help evaluate the quality of engulfing candles, not to label every engulfing pattern indiscriminately.
- The goal is to surface stronger price action events through a structured scoring model and a clearer visual workflow.
Notes:
- This update is primarily a usability and presentation refinement.
- Outputs should be interpreted in context with structure, trend, and broader market conditions.
- The script is for analysis and alerting purposes only. It is not a trade execution system and does not guarantee outcomes.
Phát hành các Ghi chú
Version 2.0 Update NotesThis update keeps the original Engulfing Candle Quality identity intact while making the script more selective, more premium visually, and more useful after the signal prints.
- Public title updated to remove the AG Pro prefix, while the panel header still keeps the AG Pro branding.
- Rebuilt the script header and visual language around the AGPro palette for a cleaner public-release presentation.
- Added confirmed-close signal control so labels, zones, and alerts can wait for bar completion by default.
- Tightened the scoring workflow around relative volume, body efficiency, engulf strength, trend context, close quality, displacement, and reaction context.
- Added Wick Sweep context detection to better separate engulfing candles that also absorb the previous extreme.
- Added Engulfing Reaction Zones that project forward from qualified signals, giving users a structured retest area instead of a one-bar pattern mark.
- Added zone basis and zone projection controls so the reaction boxes can be tuned without turning the chart into a generic S/R map.
- Improved label spacing and added stored-label limits to keep annotations readable in busy charts.
- Upgraded the premium info panel with the required merged blue header row, auto theme support, and clearer signal state metrics.
- Kept the script focused on engulfing quality so it does not drift into pin bar, displacement, breakout-failure, or institutional-candle territory.
This release is designed to feel sharper on first look, cleaner in live chart use, and more differentiated inside the AGPro public script lineup.
Phát hành các Ghi chú
UPDATE NOTES - v2.1This update focuses on decision clarity.
The core purpose of the script remains unchanged.
This release improves how the existing engulfing quality model and reaction
zones are summarized at the top of the info panel.
This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.
------------------------
What Changed
------------------------
• Next Action readout
The info panel now leads with a plain-language Next Action line that turns the
current engulfing read into a single suggested response. It reflects a live
qualified engulf, its quality tier, and any active reaction zone. Examples
include Long Setup - Bull Engulf, Watch Short - Bear Engulf, Watch Long - Bull
Zone Live, and Stand Aside - No Signal.
• Action-first panel order
The Next Action line sits directly under the header, above the existing Current
Bar, Last Score, statistics, ratio, reaction zone, and context rows, so the
most actionable read is the first thing seen.
• Adaptive panel contrast
The Next Action cell uses a luminance-aware text color so it stays crisp and
readable across the dark and light panel themes.
------------------------
Visual Improvements
------------------------
• Improved first-glance interpretation by surfacing the most actionable
information at the very top of the panel.
• Refined visual hierarchy so the lead read stands out above the supporting
statistics.
• Kept all qualified engulfing labels, candle coloring, reaction zones, and
background highlighting at their existing balanced settings.
------------------------
Interface & Usability
------------------------
• Optimized panel layout for clearer information flow from action to context.
• Improved label readability inside the panel.
• Enhanced overall user experience without changing core logic.
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
The engulfing detection, the seven-part quality model, pivot, EMA, and wick
sweep context bonuses, reaction zones, and score labels behave exactly as
before. The Next Action line is a readability layer built directly on top of the
existing signal, score, and zone outputs.
Users should interpret outputs the same way as before, now with a clearer
summary of the current engulfing context.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Market conditions such as volatility, liquidity, and timeframe differences may
affect how engulfing candles register and how reaction zones hold.
Outputs should always be interpreted within broader market context.
------------------------
Risk Reminder
------------------------
This script is for educational and analytical purposes only.
It does not provide financial advice or guaranteed trading outcomes.
Users remain responsible for their own decisions.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Public-free scripts + invite-only AGPro workflows for market analysis, liquidity context, risk planning and execution review.
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Public-free scripts + invite-only AGPro workflows for market analysis, liquidity context, risk planning and execution review.
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.