AG Pro Premium Discount Zone Engine [AGPro Series]AG Pro Premium Discount Zone Engine
Overview / What it does
AG Pro Premium Discount Zone Engine is a dealing-range and retracement context overlay built to map relative value inside a selected swing. Instead of treating price as a sequence of isolated candles, the script frames current price location against an active high-low range and highlights where price is trading relative to equilibrium, premium, discount, and the OTE area.
The core purpose of this tool is organizational. It is designed to help traders read where price is positioned inside a live swing and how price reacts when it moves into higher-value or lower-value retracement zones. This is especially useful when a chart is moving inside a pullback, when trend continuation is being evaluated, or when users want to distinguish between shallow retracements and deeper repricing within an existing range.
The script supports multiple ways to define the active range. Users can work with an automatically detected swing, a higher-timeframe dealing range, or a manual-lite anchor mode based on bar offsets. Once a valid range is identified, the script projects premium and discount territory, marks the 50% equilibrium, and highlights the OTE area using the 61.8, 70.5, and 78.6 retracement levels.
The output is intentionally visual, structured, and restrained. Premium and discount zones are shown as clean value blocks. The OTE area is treated as the main focus zone rather than a minor detail. The panel summarizes the active bias, current location, zone state, equilibrium level, and OTE boundaries so that users can read the chart quickly without relying on aggressive signal language.
Unique Edge
What makes this script different is that it is not built as a market-structure detector, imbalance mapper, liquidity event scanner, or order-block locator. Its job is narrower and more specific: it organizes relative price location inside a defined dealing range.
That distinction matters. Many overlays attempt to explain everything on the chart at once. This script does not. It does not try to label breaks of structure, detect fair value gaps, mark liquidity sweeps, or classify institutional zones. Instead, it answers a more focused question: where is price trading inside the current swing, and how is it behaving as it enters or leaves important retracement territory?
This also separates the script from other AG Pro tools. Some AG Pro overlays are built around structure transitions, some around imbalance behavior, some around reaction quality, and some around event detection. AG Pro Premium Discount Zone Engine is built around valuation context. It does not compete with those tools directly. It complements them by adding a relative-value map around a selected range.
Another difference is the zone-state logic. The script does not stop at drawing premium and discount blocks. It also tracks how price interacts with the OTE area and classifies that interaction using a simple state model such as Fresh, First tap, Retested, Rejected, Accepted, and Invalidated. This creates a more contextual read than a static retracement overlay.
Methodology
The script begins by identifying an active swing range. In Auto Swing mode, it uses pivot-based range detection. In HTF Swing mode, it builds the range from a higher-timeframe high-low window. In Manual-Lite Swing mode, it uses bar-offset anchors to let the user define a practical swing reference without requiring manual drawing tools.
Once the active range is available, the script calculates the internal value map:
- Swing High
- Swing Low
- 50% Equilibrium
- Premium territory above equilibrium
- Discount territory below equilibrium
- OTE zone using 61.8, 70.5, and 78.6 retracement levels
The script then monitors how price behaves around those levels. This produces context states rather than directional promises. For example, price entering the OTE area is not treated the same as price rejecting from it, accepting beyond it, or invalidating the active range. These are intentionally different events because they describe different chart conditions.
The equilibrium level is included as a centerline reference, while the OTE band is given stronger visual emphasis. This helps distinguish broad valuation territory from the narrower retracement pocket that many users monitor more closely.
Signals & Alerts
The signals in this script are event-based and deterministic. They are not designed as standalone trade instructions. They are designed to describe interaction with the active range.
Available event logic includes:
- OTE Test
- OTE Reject
- OTE Accept
- Discount Reaction
- Premium Rejection
- Equilibrium Cross
- Range Invalidated
- OTE Failure
These events are intended to provide chart context. For example, an OTE Test simply means price entered the active OTE zone. A Premium Rejection means price traded into the premium side and closed back below the local premium threshold used by the script. A Discount Reaction means price interacted with the discount side and responded upward under the script's rules. These are context events, not guarantees of continuation.
Alerts follow the same philosophy. They are defined in a rules-based way so users can monitor range interaction without needing to watch the chart continuously. The alert layer is most useful when the script is used as a location filter inside a broader workflow.
Key Inputs
Swing mode
Lets the user choose between Auto Swing, HTF Swing, and Manual-Lite Swing depending on whether the goal is reactive automation, higher-timeframe framing, or a more controlled local range definition.
Auto pivot length
Controls how sensitive the pivot-based swing detection is in Auto mode.
HTF timeframe and HTF lookback
Used to define the broader dealing range in higher-timeframe mode.
Manual high bars back / manual low bars back
Used to create a manual-lite range by referencing earlier bars as anchors.
Render bars back / render bars forward
Controls how far the active range projection extends on the chart.
Zone opacity and theme
Used to refine the visual balance between premium, discount, and OTE areas.
Label controls
Used to reduce visual noise by controlling label cooldown, label render window, and maximum visible labels.
Panel controls
Allow the user to reposition the panel and adjust its text size to fit different chart layouts.
Limitations & Transparency
This script does not predict direction. It does not forecast reversals. It does not decide whether a chart should trend, break, or fail. It maps relative value inside a selected range and reports interaction events inside that framework.
The quality of the output depends on the quality of the active swing. If the selected or detected range is not meaningful for the user's workflow, the valuation map will also be less meaningful. This is especially important in highly compressed, extremely noisy, or structurally unclear conditions.
Auto Swing mode is practical, but like any automated swing model, it depends on pivot confirmation and may update as newer pivots become available. HTF mode provides broader context but may feel less reactive on smaller charts. Manual-Lite mode gives more control but still depends on the user choosing sensible anchor distances.
OTE logic is range-relative. It does not incorporate unrelated concepts such as order blocks, liquidity pools, fair value gaps, session models, or external structure classifications unless the user combines those ideas manually in a separate workflow.
This script is best understood as a valuation-context overlay. It is not a complete strategy, not a full decision engine, and not a substitute for risk management.
How this differs from other AG Pro scripts
AG Pro Premium Discount Zone Engine is intentionally not a structure-break tool, not a CHoCH/BOS detector, not a liquidity sweep scanner, not an FVG engine, and not an order-block mapper.
Its role inside the AG Pro family is to answer a different question:
Where is price trading inside the active dealing range, and what is the quality of its interaction with that value map?
That makes it particularly useful for users who already understand direction from another process and want cleaner execution context. In other words, some tools focus on structural change, some focus on imbalance, and some focus on reaction events. This one focuses on valuation location.
Risk Disclosure
This script is for chart analysis and educational use only. It does not provide financial advice, investment advice, or guaranteed trade signals. Any use of this tool should be combined with independent analysis, risk controls, position management, and market-specific judgment.
The presence of an alert, label, premium zone, discount zone, or OTE interaction does not imply that price must react in a specific way. Markets can continue, reverse, compress, or invalidate a range without warning. Users should treat this script as a context tool, not as a promise of outcome.
Penunjuk Pine Script®










