OPEN-SOURCE SCRIPT
ที่อัปเดต:

Opening Range Retest Planner [AGPro Series]

927
# Opening Range Retest Planner [AGPro Series]

## Core Idea

Did the opening range breakout return to its boundary and hold with enough quality to deserve attention?

## Overview / What It Does

Opening Range Retest Planner is an intraday opening range decision-support script built for traders who want to evaluate the quality of the first meaningful retest after an opening range breakout.

The script builds the opening range, tracks the first bullish or bearish breakout, maps a focused retest pocket around the broken boundary, grades the retest from 0 to 100, and displays a clear action state in a compact AG Pro panel.

It does not predict price direction, automate execution, or provide guaranteed outcomes. Its purpose is to organize structure, acceptance, invalidation, and retest quality in a clean visual workflow.

## Purpose & Design Philosophy

Many opening range tools focus only on the initial break. In practice, the first retest after the break is often where the structure becomes more meaningful.

This script was built for traders who want to separate a clean retest hold from a weak pullback, failed breakout, or expired setup. The design supports structured observation instead of impulsive reaction.

## Why This Script Is Different

Most opening range tools stop at the range or breakout itself.

This script does not stop there.

Instead, it focuses on what happens after the break: whether price returns to the broken boundary, respects it, fails back inside the range, or runs out of time before a qualified retest appears.

## Methodology

1. Opening Range Mapping
2. Breakout Detection
3. Retest Pocket Construction
4. Retest Quality Scoring
5. Acceptance, Invalidation, or Expiration State
6. Panel and Alert Output

## How To Read The Chart

The opening range remains the main session reference.

The retest pocket marks the area where the script evaluates whether the broken boundary is being respected or rejected.

Labels highlight qualified retests, invalidations, and key state changes.

Target rails project possible continuation space after a qualified retest.

The panel summarizes OR state, retest score, acceptance side, failure risk, and current action.

## Signals & States

READY -> A retest touched the pocket, held the broken boundary, and met the minimum quality threshold.

MONITOR -> A breakout occurred and the script is tracking whether a qualified retest develops.

WAIT -> The opening range is still building, has just locked, or is waiting for a valid post-break condition.

INVALIDATED -> Price failed back inside the opening range after the breakout.

EXPIRED -> The retest window closed without a qualified retest.

BLOCKED -> The opening range is not valid enough to evaluate.

## Alerts Logic

Bullish Opening Range Retest Ready triggers when a bullish breakout retest holds the broken range high with enough score.

Bearish Opening Range Retest Ready triggers when a bearish breakout retest holds the broken range low with enough score.

Opening Range Retest Invalidated triggers when price fails back inside the opening range after a breakout.

Opening Range Retest Expired triggers when the retest window expires without a qualified hold.

Alerts are attention markers, not trade instructions.

## Confluence Logic

The retest score combines pocket touch quality, close response, retest timing, relative volume, opening range volatility fit, and available target room.

When these conditions align, the context becomes stronger. When they do not align, the panel remains in MONITOR, WAIT, INVALIDATED, or EXPIRED state.

## When To Use

This script is most useful in liquid intraday markets where the opening range matters and session structure is clear.

It fits breakout-retest workflows, opening drive continuation, failed breakout monitoring, and structured intraday planning.

## When NOT To Use

Avoid relying on this script in very low-liquidity symbols, extremely noisy sessions, holiday trading, or chart conditions where the opening range session cannot be represented cleanly.

## Key Inputs

Opening Range Mode controls whether the script uses an exact session window or the first chart bars of each day.

Auto mode uses session-window logic on lower intraday charts and switches to first-bars-of-day logic on higher timeframes.

Retest Pocket ATR controls the depth of the retest zone around the broken boundary.

Minimum Ready Score controls how strong the 0-100 retest score must be before READY appears.

Panel and label controls let users adjust position, theme, and visual density.

## Interface & Visual Design

The visual design is chart-first.

The opening range stays readable, the active retest pocket becomes the focus area, and the panel provides compact decision context without covering the whole chart.

The first panel row uses the AG Pro blue header style and shows only the script name.

## Practical Usage Workflow

1. Wait for the opening range to lock.
2. Watch for a breakout beyond the range boundary.
3. Observe whether price returns to the retest pocket.
4. Check the retest score and action state.
5. Treat alerts as attention markers and confirm context with your broader process.

## What This Script Is NOT

This script is not a prediction engine.

It is not financial advice.

It is not an auto-trading system.

It does not guarantee outcomes.

It does not replace independent risk management or market context.

## Limitations & Transparency

Opening range behavior changes across markets, sessions, liquidity conditions, and timeframes.

The score is rule-based and depends on the configured session, ATR normalization, volume behavior, and retest window.

Different chart timeframes may display session structure differently.

## Risk Disclosure

Trading involves risk.

Users remain responsible for their own decisions.

This script is for educational and analytical purposes only and does not provide financial advice or guaranteed trading outcomes.
Release Note
UPDATE NOTES - V1.2

This update focuses on hourly chart presentation, label pacing, and cleaner publication screenshots.

The core purpose of the script remains unchanged.
This release improves how the existing opening range retest logic appears when the chart is used as an active 1H decision-support view.

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

• Shortened ready retest label text.
Ready labels now use a more compact READY | Q format, reducing horizontal crowding around active price areas.

• Reduced default historical event label count.
The script now keeps fewer historical event labels by default, creating a cleaner hourly chart presentation.

• Added label cooldown control.
Repeated ready labels are now paced by a new cooldown input, reducing clusters while preserving the most important decision markers.

• Preserved centered structure badges.
The opening range and retest pocket badges remain visible and contrast-safe for dark and light chart themes.

• Preserved core retest logic.
Opening range construction, breakout detection, retest scoring, target rails, alerts, and panel behavior remain unchanged.


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

• Improved 1H chart readability by reducing repeated ready label density.

• Refined event label wording for a cleaner premium look.

• Reduced overlap risk around clustered retest areas.

• Preserved the visual hierarchy between OR box, retest pocket, target rails, and panel.


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

• Added Label Cooldown Bars as a visual setting.

• Users can still increase label count or reduce cooldown manually if they prefer denser historical markers.

• The AG Pro panel format and merged blue header remain unchanged.

• Adjustable panel and label font-size controls remain available.


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

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

The goal is to improve clarity and usability, not to introduce new predictive behavior.

Users should interpret outputs the same way as before, but with improved visual structure.


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, session behavior, and timeframe differences may affect how signals 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 Note
🔧 UPDATE NOTES - v1.3

This update focuses on clarity, readability, and decision context.

The core purpose of the script remains unchanged.
This release improves how the existing opening range retest logic is presented
and adds an honest historical follow-through measure to the decision 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
------------------------

• Retest Proof panel section
The decision panel now carries a dedicated "— RETEST PROOF —" section. After a
retest is accepted (READY), the engine measures whether price followed through
by one ATR in the break direction before pulling back one ATR against it, and
reports that follow-through rate with its sample size. It shows "Building" until
enough samples exist. This is a transparent, symmetric, after-the-fact context
measure — not a prediction.

• High-contrast label ink
All on-chart badges and tags (opening range badge, retest pocket badge, READY,
right-side OR High / OR Low / OR Mid / target tags, and the panel acceptance and
action cells) now use a luminance-based ink rule, so text stays sharp and
readable on both bright and dark badge fills across both panel themes.

• Hardened volatility reference
The ATR reference used for buffers, pockets, label offsets, and scoring is now
floored so it stays stable on low-data and low-liquidity symbols.


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

• Improved label readability on teal, pink, amber, and indigo badges.

• Reduced visual clutter to enhance first-glance interpretation.

• Refined visual hierarchy so the opening range, the retest pocket, and the
projected targets read as one connected story.

• Adjusted ink so text stays clearly legible against candles and badge fills.


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

• Optimized panel layout for clearer information flow, with the retest proof
presented in its own section.

• Improved label readability for better chart interaction.

• Adjusted default visual settings for a more balanced appearance.

• Enhanced overall user experience without changing core logic.


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

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

Opening range building, breakout detection, retest scoring, acceptance, and
invalidation all behave exactly as before. The new follow-through measure is a
panel-only context statistic and does not affect any signal.


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may
affect how signals appear. The follow-through rate is a historical context
measure and does not guarantee future behavior.

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.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน