OPEN-SOURCE SCRIPT
Updated

Opening Drive Quality [AGPro Series]

779
Opening Drive Quality [AGPro Series]


🧠 Core Idea

Is the first directional drive of the session strong enough to plan around, or is it already losing execution quality?


📌 Overview / What it does

Opening Drive Quality is a session execution planner that evaluates the first directional drive after the market opens. It studies the opening drive channel, early follow-through, pullback acceptance, risk-line integrity, and target-room structure in one clean decision framework.

The script produces a 0-100 quality score, a clear next-action state, an opening drive channel, a pullback acceptance zone, an invalidation risk line, target guide, compact chart labels, alerts, and a premium AGPro panel.

It does not predict price direction, automate trades, or mark every opening range breakout. Its purpose is to help traders evaluate whether the early session drive has enough structure, acceptance, and risk clarity to deserve attention.


🎯 Purpose & Design Philosophy

The script was built for traders who need more than an opening range box or a simple breakout marker. The first session move often sets the tone, but the useful question is not only whether price moved. The useful question is whether that move produced clean follow-through, controllable risk, and a meaningful pullback area.

Opening Drive Quality fills that gap by turning the opening move into a structured planning map. It supports traders who study session execution, intraday momentum, and pullback planning without relying on generic signals.

The design philosophy is simple: evaluate the quality of the first drive, define the risk line, project the pullback acceptance zone, and make the next state readable at a glance.


⚡ Why This Script Is Different

Most tools focus on opening range breakouts, session boxes, fixed kill zones, or failed-break signals.

This script does NOT try to clone a generic ORB tool, a kill-zone session engine, or an opening range failure map.

Instead, it focuses on the quality of the first directional drive itself. It asks whether the drive has real thrust, whether follow-through appears after the drive locks, whether price accepts a pullback zone, where the risk line sits, and what the next planning state should be.


⚙️ Methodology

1. Context Detection

The script builds the opening drive from either a fixed session window or the first bars of a new day. This keeps the tool useful across regular-market assets and 24/7 markets.

2. Reference Mapping

After the drive locks, the script maps the opening drive channel, pullback acceptance zone, invalidation risk line, and target-room guide. These references come from the opening drive structure, not from generic support and resistance pivots.

3. Reaction Evaluation

The engine scores drive thrust, close location, range expansion, optional relative volume, follow-through distance, pullback behavior, and risk-line integrity.

4. Visual Output

The chart shows the active drive channel, projected pullback zone, risk line, target guide, state labels, and a compact panel with the key planning reads.


🗺️ How to Read the Chart

Opening Drive Channel = the locked first directional drive of the session.

Pullback Acceptance Zone = the area where a controlled pullback can be evaluated after a valid drive.

Risk Line = the invalidation line derived from the drive base, pullback zone, and ATR buffer.

Target Guide = a projected target-room reference based on the opening drive range.

Labels = compact markers for drive lock, follow-through, pullback acceptance, weak drive, risk break, and target check.

Colors = teal for bullish drive context, pink for bearish drive context, amber for review states, and indigo for structural emphasis.

Panel = the decision layer showing Drive Side, Follow-Through, Pullback Quality, Risk Line, and Action.


🚦 Signals & States

• DRIVE Q → the opening drive has locked and received a 0-100 quality score.

• FOLLOW Q → the drive has produced directional follow-through after locking.

• PULLBACK ACCEPTED → price is reacting constructively inside the projected pullback acceptance zone.

• WEAK DRIVE → follow-through has not developed inside the review window.

• RISK BROKEN → the active drive has violated its invalidation line.

• TARGET CHECK → price has reached the projected target-room guide.


🔔 Alerts Logic

The script includes alerts for:

• Opening Drive Quality Locked → a qualified opening drive has completed.

• Drive Follow-Through → directional extension appears after the drive locks.

• Pullback Accepted → price reacts inside the projected pullback acceptance zone.

• Risk Line Broken → price violates the active drive risk line.

• Target Guide Reached → price reaches the projected target-room guide.

Alerts are attention markers. They are not trade instructions.


🧩 Confluence Logic

The context becomes stronger when opening drive thrust, close location, session volatility, relative volume, follow-through, and pullback acceptance align.

The context becomes weaker when the opening drive locks with poor thrust, cannot extend, pulls back too deeply, or breaks the risk line.


📊 When to Use

• Intraday session planning.

• Opening-drive analysis after the first market push.

• Markets where the opening session often defines early direction.

• Pullback planning after a strong first drive.

• Session review where risk line and target-room context matter.


⚠️ When NOT to Use

• Very low-liquidity markets.

• Extremely noisy opens with unstable spreads.

• News-driven bars where the first drive is unusually distorted.

• Assets where the selected opening session is not meaningful.

• Higher timeframes where the opening drive window has no practical session context.


🎛️ Key Inputs

• Opening Drive Mode → chooses first bars of day or a fixed session window. First Bars Of Day is the default so the chart loads with visible drive structure across more symbols.

• Opening Drive Session → defines the drive-building window.

• Tracking Session → defines when follow-through and pullback logic remains active.

• Minimum Quality Threshold → controls when stronger planning labels appear.

• Follow-Through ATR → defines the extension needed for follow-through confirmation.

• Pullback Acceptance Depth → controls the projected pullback zone depth.

• Risk Line Buffer ATR → adjusts the invalidation line beyond the drive structure.

• Target Guide Multiple → controls the projected target-room guide.

• Panel / Label Settings → control panel location, theme, font size, label size, visible label count, minimum label quality, label cooldown, and optional compact plot markers.


🖥️ Interface & Visual Design

The interface is built around a clean AGPro panel and chart-first planning visuals. The panel uses a single merged blue header row with only the script name, then five practical rows: Drive Side, Follow-Through, Pullback Quality, Risk Line, and Action.

The chart uses one opening drive channel, one pullback acceptance zone, one risk line, one target guide, and compact labels. The goal is a premium session-planning view without clutter.


🧪 Practical Usage Workflow

1. Read the panel after the opening drive locks.

2. Check whether the drive side and score show a valid planning context.

3. Watch follow-through quality after the drive locks.

4. Evaluate whether price pulls back into the acceptance zone constructively.

5. Use the risk line and target guide as planning references, not automatic decisions.


🔍 Interpretation Guidelines

A strong score means the opening drive has better structure, cleaner close location, stronger volatility context, and better follow-through support.

A pullback acceptance label means price is reacting inside the projected drive-based zone. It does not mean price must continue.

A risk-line break means the original drive plan has lost structural integrity and should be reassessed.

The most useful interpretation comes from combining the panel state with broader market context, liquidity, and timeframe alignment.


🚫 What This Script Is NOT

• Not a prediction engine.

• Not financial advice.

• Not an auto-trading system.

• Not guaranteed signals.

• Not a generic support and resistance mapper.

• Not a clone of an ORB breakout tool.

• Not a kill-zone timing dashboard.

• Not an opening range failure scanner.


⚠️ Limitations & Transparency

Timeframe selection affects the opening drive shape. A 5-minute chart and a 15-minute chart can produce different drive channels.

Volatility changes can expand or compress the pullback zone and risk line.

Session definitions matter. The selected opening window should match the asset being studied.

High-impact news, abnormal spreads, and low liquidity can reduce the reliability of the opening drive map.


🧠 Market Context Notes

Opening drives are most useful when liquidity is active and the first session push creates a clear directional reference. A clean drive does not guarantee continuation, but it can create a structured area for evaluating pullback acceptance and invalidation.

The script intentionally keeps its references tied to the opening drive. It avoids pivot maps, order block language, broad S/R zones, and generic failed-break logic.


🧾 Use Case Examples

When price locks a strong bullish opening drive, extends beyond the channel, and then pulls back into the acceptance zone without breaking the risk line, the panel may shift toward a constructive planning state.

When price locks a drive but cannot create follow-through inside the review window, the script can mark the drive as weak and shift the action state toward bias reduction.

When price violates the risk line, the original opening drive plan is no longer structurally intact inside this model.


🧱 System Philosophy

Opening Drive Quality follows the AGPro decision-engine philosophy: a script should help the trader evaluate validity, strength, risk, target room, and next state instead of only printing another signal.

The tool is designed to make the opening session easier to interpret through structured references and clean visual hierarchy.


🔐 Non-Promise Statement

No script can provide certainty.

No opening drive model can guarantee continuation, reversal, or profitability.

This script provides structured context only.


📉 Risk Disclosure

Trading involves risk.

Users are responsible for their own decisions.

This script does not provide financial advice, investment advice, or guaranteed trading outcomes.


📚 Educational Note

Use this script as an educational planning and visualization tool. The strongest use comes from reading the opening drive together with broader market structure, liquidity, volatility, and personal risk rules.
Release Notes
UPDATE NOTES - V1.6

This update focuses on zone-badge positioning, publication-screen readability, and cleaner multi-timeframe presentation.

The core purpose of the script remains unchanged.
This release improves how the pullback acceptance zone badge is placed and read on compressed charts.

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
------------------------

* Updated the public package to V1.6.
The header, code file, update notes, tags, and QA file now use the refreshed version.

* Changed the default zone badge placement to Smart Edge.
Zone badges now start from the projected edge by default, reducing the chance that the pullback zone badge appears transposed into the candle cluster.

* Moved Smart Edge badges farther into the projection area.
The x-position now favors the live right edge of the projected channel or zone, improving the 1H and 4H screenshots without changing the analytical model.

* Shortened pullback zone badge text.
PB | OK and PB | TEST were refined to PB OK and PB TEST for cleaner label width and better chart balance.

* Preserved the opening drive planning model.
Drive quality, follow-through review, pullback acceptance, risk line, target guide, panel state, and alerts remain intact.


------------------------
Visual Improvements
------------------------

* Improved chart readability by moving active zone badges away from the candle body cluster.

* Reduced the visual width of pullback zone text.

* Preserved contrast-safe colored badges for dark and light chart themes.

* Improved 4H publication screenshot balance while keeping the 1H view usable.


------------------------
Interface & Usability
------------------------

* Smart Edge is now the default Zone Badge Placement.

* Centered placement remains available for users who prefer zone-centered labels.

* Existing panel show/hide, panel location, panel theme, panel font size, label font size, and visual toggles remain available.

* The update improves first-glance interpretation without increasing visual clutter.


------------------------
Behavior Notes
------------------------

This update does not change the core analytical logic of the script.

Opening drive construction, drive scoring, follow-through scoring, pullback acceptance, risk-line checks, target guide logic, and alerts remain conceptually unchanged.

The goal is to improve visual placement and publication readiness, not to introduce new predictive behavior.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, timeframe differences, and session selection may affect how the opening drive and follow-through states appear.

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.
Release Notes
UPDATE NOTES - Version 1.7

This update focuses on adding a confirmation-anchored proof layer to the panel.

The core purpose of the script remains unchanged.
This release adds a proof layer that measures how often a locked opening drive reached its own
projected target guide before its own risk line.

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
------------------------

* Added a Proof Layer (Follow / Hold / React / Flip)
The panel now reports how locked opening drives resolved on the current symbol and timeframe.
Each time a drive locks with a direction, the script tracks it forward over a configurable horizon
using the drive's own projected levels: the entry is the lock close, the adverse reference is the
drive's own risk line, and the favorable reference is the drive's own target guide.
- Follow Rate : share of locked drives that reached the target guide before the risk line
- Hold Rate : share whose risk line was not broken through resolution
- React Rate : share that produced an early favorable reaction toward the target guide
- Flip Rate : share whose risk line was broken, meaning the drive was invalidated
A sample size (n) is shown so the rates are read in context, and they display as "building" only
until the first drive resolves.

* Converted the panel to a rebuild-aware structure
The panel now rebuilds cleanly when the location, theme, font size, visibility, or proof layer is
changed from settings, so the proof rows appear and disappear without leaving stale cells. The
existing Drive Side, Follow-Through, Pullback Quality, Risk Line, and Action rows are unchanged.

* Added hidden proof outputs
The Follow, Hold, React, and Flip rates are exported as hidden plots so they can be used in alerts
and screeners without adding chart clutter.


------------------------
Visual Improvements
------------------------

* Kept the opening drive channel, pullback acceptance zone, risk line, target guide, zone badges,
and event labels exactly as before.

* Preserved the existing label cooldown, label-quality gate, and max-visible-label limits so the
chart stays active but not crowded.

* The proof rows extend the panel only when the proof layer is enabled.


------------------------
Behavior Notes
------------------------

This update does not change the core drive, scoring, follow-through, pullback, risk, or target
logic.

The proof rates are descriptive statistics of locked drives on the current symbol and timeframe.
They measure how often a drive reached its own target guide before its own risk line, and they do
not change how drives, scores, zones, risk lines, or target guides are produced.

Users should interpret outputs the same way as before, now with added reliability context.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Proof rates depend on the available history and on how many drives locked on the current symbol
and timeframe; a small sample (low n) should be treated with caution. Each locked drive is counted
once, with the entry, risk line, and target guide frozen at the lock bar. Market conditions such as
volatility, liquidity, session structure, and timeframe differences may affect how drives and rates
appear.

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.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.