AG Pro Reference Price Operating Map [AGPro Series]AG Pro Reference Price Operating Map
Overview / What it does
AG Pro Reference Price Operating Map is an overlay that organizes the four most universally watched intraday reference prices — Daily Open, Weekly Open, Monthly Open, and Previous Close — into a single operating map with real-time state tracking and control attribution.
Instead of drawing these levels as static horizontal lines and leaving interpretation to the user, the script tracks how price interacts with each reference during its current period and classifies every reference into one of five states: Untouched, First Touch, Tested, Held, Reclaimed, or Rejected. A proximity and state-weighted control score determines which reference is currently dominant, so the chart answers a direct question: which reference is controlling the session right now.
When two or more references cluster within the same price area, the script automatically merges them into a single confluence label. When a reference drifts far from current price, it is rendered as a thin gray context zone instead of a hard line. The goal is a clean, readable operating map rather than a collection of unrelated horizontal levels.
Unique Edge
Most reference-price tools draw Daily Open, Weekly Open, Monthly Open, and Previous Close as flat lines and stop there. This script is different in three ways.
First, each reference runs through its own independent state machine. The chart communicates not just where the references are, but what happened when price reached them. A line that has been Rejected looks different from one that has been Reclaimed, which looks different from one that has only been Tested.
Second, a control-score layer ranks all active references by proximity and interaction quality, then marks the dominant one directly in the panel footer and with a thicker line on the chart. The user does not have to visually compare four references and guess which one matters most.
Third, a confluence grouping engine merges labels when two or more references are within half an ATR of each other. A single combined label such as "D-Open + PClose" replaces two overlapping labels, which keeps the right edge of the chart clean even when references coincide.
This script does not attempt to be a PDH/PDL sweep tool, a support and resistance dashboard, a VWAP overlay, or a multi-level indicator bundle. It focuses narrowly on the four reference prices that define session bias, tracks their state, and communicates which one is in control.
Methodology
1. Reference price calculation
The script calculates four reference prices using confirmed higher-timeframe data from request.security.
- Daily Open: opening price of the current trading day.
- Weekly Open: opening price of the current trading week.
- Monthly Open: opening price of the current calendar month.
- Previous Close: closing price of the prior trading day.
2. Proximity detection
Touch and rejection thresholds are defined in ATR multiples so the logic adapts to volatility. A reference is considered "touched" when price enters an ATR-based proximity band. Wick-based detection is supported so that intrabar penetration of the level is not missed.
3. State engine
Each reference runs through an independent state machine.
- Untouched: price has not reached the proximity band yet in this period.
- First Touch: price touched the reference for the first time in the current period.
- Tested: price is interacting with the reference but has not resolved the interaction.
- Held: price moved away from the reference in the expected direction.
- Reclaimed: price crossed through the reference and confirmed on the other side.
- Rejected: price touched the reference and produced a large-wick reversal.
Period resets are applied at the start of each relevant period: daily for Daily Open and Previous Close, weekly for Weekly Open, monthly for Monthly Open.
4. Control score
Each active reference is scored using a combination of state weight and proximity. Reclaimed carries the highest state weight, followed by Rejected, First Touch, Tested, and Held. The reference with the highest total score is marked as dominant. If the market is in an unresolved phase with no dominant reference, the footer reads "No Active Control".
5. Confluence grouping
References within half an ATR of each other are grouped into a single label, led by the reference with the highest priority. Priority is based on dominant status first, then state weight, then a fixed tiebreak order. This prevents right-edge label overlap and surfaces confluence naturally.
6. Distance-aware rendering
References further than a user-configurable ATR multiple from current price are treated as "far" and are drawn with a thin theme-neutral gray zone and a dotted gray line rather than a full colored band. This keeps distant references visible as context without competing with the active map.
Signals & Alerts
The script includes three confirmed-bar alerts:
- Reference Touched: fires when any reference transitions from Untouched to its first interaction state during its current period.
- Reference Reclaimed: fires when price crosses back through a reference and confirms on the other side.
- Reference Rejected: fires when price touches a reference and produces a confirmed reversal bar.
All alerts use confirmed-bar logic. The alerts follow the script's state engine rather than subjective interpretation.
Key Inputs
Reference Lines
- Show Daily Open, Show Weekly Open, Show Monthly Open, Show Previous Close: independent visibility toggles for each reference.
Display Mode
- Show Active Only: hides references that are still Untouched and Far, showing only references that have interacted with price.
- Strict Reclaim Mode: requires multi-bar confirmation for reclaim events to filter single-bar wick noise.
- Label Density: Minimal shows only the dominant reference label, Normal shows all visible references, Detailed adds state text to each label.
- Show Reaction Bands: toggles the ATR-based proximity bands around active references.
- Mark First Touch: places a small diamond marker at the bar where a reference is touched for the first time.
Panel Settings
- Panel Position: Top Right, Top Left, Bottom Right, or Bottom Left.
Sensitivity
- Touch Threshold (ATR x): how close price must come to a reference to count as a touch.
- Reclaim Confirm Bars: bars required on the reclaim side for confirmation.
- Band Width (ATR x): visual width of active reaction bands.
- Far Distance (ATR x): distance beyond which a reference is rendered as far context rather than active structure.
How to use it
Most users will treat this script as a session bias and reaction map rather than as a standalone entry system.
A common workflow is:
- open the panel and identify the currently dominant reference.
- check whether price is trading above or below that dominant reference.
- observe the state labels on the chart. Reclaimed and Rejected references often carry more behavioral weight than simply Tested or Held ones.
- watch confluence zones where two or more references cluster. A "D-Open + PClose" confluence is a different decision surface than a lone Daily Open.
- use the far-context gray zones for awareness of broader anchors that are not currently in play, without letting them dominate the active map.
The script complements trend, structure, order flow, momentum, and risk management tools. It is not intended to replace them.
Limitations & Transparency
- The script tracks four specific reference prices only. It does not include PDH, PDL, PWH, PWL, intraday VWAP, or any moving average.
- Proximity is ATR-based. In extremely low-volatility environments the touch threshold may need manual adjustment.
- Control score is a relative ranking tool, not a predictive model. A dominant reference does not guarantee continuation.
- References are derived from standard timeframe data. Non-standard chart types may produce unexpected results.
- The script is designed for intraday and swing timeframes. On very high timeframes, such as monthly charts, the operating map concept becomes less relevant.
- State resets occur at period boundaries. Late-session state changes near a reset point may not have time to fully develop before the reset.
- First Touch markers are limited to recent bars to avoid historical clutter.
Risk Disclosure
This indicator is not a strategy, not a trading signal generator, and not a substitute for proper risk management. It is a reference-price organization tool intended to support discretionary chart reading. The state classifications, control scores, and confluence labels are analytical frameworks, not predictions of future price movement. All trading involves risk. Users should combine this tool with their own analysis, risk management, and independent confirmation before making any trading decisions.
Pine Script® indicator






















