OPEN-SOURCE SCRIPT
Updated Range Equilibrium Rotation Planner [AGPro Series]

Range Equilibrium Rotation Planner [AGPro Series]
🧠 Core Idea
Is price rotating cleanly away from range equilibrium toward an edge, or is the midpoint still controlling the auction?
📌 Overview / What it does
Range Equilibrium Rotation Planner [AGPro Series] maps mature range structure and focuses on the midpoint equilibrium area instead of treating every range as a breakout setup.
The script displays the active range box, equilibrium band, edge rails, rotation room rail, failure rail, event labels, right-side tags, optional bar coloring, and a compact AG Pro dashboard with a 0-100 Rotation Score.
It does not predict range breaks. It helps organize range balance, midpoint control, directional rotation, edge room, failure risk, and next-action state.
🎯 Purpose & Design Philosophy
Many range tools focus on support, resistance, or breakout alerts.
This script was built for a different question: what happens inside the range before price reaches the edge?
It helps traders review whether price is still trapped around equilibrium or beginning a clean rotation from the midpoint toward the upper or lower edge.
⚡ Why This Script Is Different
Most range indicators draw a box and wait for a breakout.
This script does NOT center the workflow on range escape.
Instead, it evaluates range maturity, midpoint control, rotation quality, edge room, and failure back through equilibrium. The goal is rotation planning, not breakout prediction.
⚙️ Methodology
1. Range Maturity Detection
The script builds a rolling range using recent high and low structure, then checks whether the height and edge interactions are meaningful.
2. Equilibrium Mapping
The midpoint band is calculated around the center of the range and becomes the key control zone.
3. Rotation Evaluation
Price must move away from equilibrium with enough buffer before directional rotation is considered active.
4. Risk / Room Structure
The active edge becomes the room reference, while the opposite side of equilibrium becomes the failure area.
5. Visual Output
The chart receives a range box, equilibrium band, edge rails, room rail, failure rail, labels, right-side tags, optional bar coloring, and dashboard panel.
🗺️ How to Read the Chart
The range box marks the current high-to-low structure.
The equilibrium band shows the midpoint area where rotation control is evaluated.
The upper and lower rails mark the active range edges.
The room rail marks the edge being targeted by the active rotation.
The failure rail marks where rotation has moved back through the wrong side of equilibrium.
Labels highlight mature ranges, rotations from midpoint, equilibrium holds, edge reviews, and failed rotations.
Colors represent context:
• Teal → bullish rotation
• Pink → bearish rotation or failure
• Gold → equilibrium, room, or edge review
• Indigo → range structure or waiting context
The panel summarizes:
• Range
• Rotation Score
• Balance
• Room
• Action
🚦 Signals & States
• Range Ready → a mature range structure is available
• Bull Rotation → price rotated upward from equilibrium
• Bear Rotation → price rotated downward from equilibrium
• Midpoint Hold → price remains controlled by the equilibrium band
• Edge Review → price reached the active range edge
• Failed → rotation moved back through the failure rail
• READY → rotation quality and room are strong enough to monitor
• MONITOR → rotation is active but not fully ready
• WAIT RANGE → no mature range exists
• WAIT ROTATION → range exists but no clean rotation has started
🔔 Alerts Logic
Alerts can trigger when a mature range appears, when bullish or bearish rotation begins, when READY state appears, when midpoint hold appears, when an edge is reached, or when the rotation fails.
Alerts are attention markers only. They are not trade instructions.
🧩 Confluence Logic
The context becomes stronger when range maturity, balanced edge interaction, midpoint departure, edge room, and failure distance align.
The script avoids treating midpoint noise as a clean rotation without confirmation.
📊 When to Use
• Sideways markets with visible range structure
• Crypto, forex, indices, and liquid stocks
• 1H, 4H, and 1D market structure review
• Mean-reversion planning inside a range
• Range edge preparation without waiting for breakout-only logic
⚠️ When NOT to Use
• Strong one-directional trends with no range structure
• Thin symbols with unreliable highs and lows
• News-driven candles that distort range boundaries
• Very small ranges where spread or tick noise dominates
• Markets with unstable data or irregular sessions
🎛️ Key Inputs
• Range Lookback → controls the structure used to build the range
• Minimum / Maximum Range Height ATR → filters ranges that are too small or too wide
• Edge Touch Tolerance → controls how edge interactions are counted
• Equilibrium Band ATR → controls midpoint band width
• Rotation Break Buffer → controls how far price must move beyond equilibrium
• Minimum Ready Score → controls READY strictness
• Projection Bars → controls how far boxes, rails, and tags extend
• Visual settings → control labels, tags, panel location, theme, and font size
🖥️ Interface & Visual Design
The panel is designed to show the range state, rotation quality, balance, room, and action without overloading the chart.
The first row uses a merged AG Pro header. The chart layer keeps the range and equilibrium structure visible while leaving room for price action.
Labels are controlled with cooldown and maximum count settings to preserve a premium screenshot style.
🧪 Practical Usage Workflow
1. Read the panel.
2. Confirm a mature range exists.
3. Check whether price is still at equilibrium or rotating away.
4. Review room to the active edge.
5. Watch the failure rail if rotation loses control.
🔍 Interpretation Guidelines
A high score means range maturity, midpoint departure, and edge room are aligned.
A midpoint hold means equilibrium is still controlling the auction.
An edge review means the rotation has reached the active range edge and should be interpreted as context, not as an automatic exit.
A failed state means the active rotation moved back through its failure boundary.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not financial advice.
It is not an automated trading system.
It does not place orders.
It does not guarantee edge reach, reversal, breakout, or profitability.
⚠️ Limitations & Transparency
Range boundaries can shift as new highs or lows appear.
Different timeframes may show different range structures.
Large volatility events can temporarily distort range height and edge touch quality.
Low liquidity may create unreliable equilibrium or edge behavior.
The script is rule-based and should be interpreted within broader market context.
🧠 Market Context Notes
Equilibrium is often where the market decides whether price will rotate toward an edge or remain balanced.
The strongest rotation contexts usually appear when price leaves midpoint with room, while failure remains clearly defined.
This script is designed to make that inside-range decision point easier to read.
🧾 Use Case Examples
When price holds near midpoint and then closes above the equilibrium band, the script can begin tracking bullish rotation toward the upper range edge.
When price rotates downward from equilibrium and reaches the lower edge, the context shifts into edge review rather than fresh entry signaling.
When price moves back through the failure rail, the active rotation context fails.
🧱 System Philosophy
AGPro Series tools are built as decision-support systems.
They aim to convert market structure into readable context: what is active, what improves the plan, what invalidates it, and what should be reviewed next.
🔐 Non-Promise Statement
No script can provide certainty.
No signal guarantees outcome.
This tool provides structured context only.
📉 Risk Disclosure
Trading involves risk.
Markets can move quickly and unexpectedly.
Users are responsible for their own analysis, risk management, and decisions.
This script does not provide financial advice.
📚 Educational Note
Use this tool to study how range equilibrium, midpoint control, rotation quality, and edge room interact across different symbols and timeframes.
🧠 Core Idea
Is price rotating cleanly away from range equilibrium toward an edge, or is the midpoint still controlling the auction?
📌 Overview / What it does
Range Equilibrium Rotation Planner [AGPro Series] maps mature range structure and focuses on the midpoint equilibrium area instead of treating every range as a breakout setup.
The script displays the active range box, equilibrium band, edge rails, rotation room rail, failure rail, event labels, right-side tags, optional bar coloring, and a compact AG Pro dashboard with a 0-100 Rotation Score.
It does not predict range breaks. It helps organize range balance, midpoint control, directional rotation, edge room, failure risk, and next-action state.
🎯 Purpose & Design Philosophy
Many range tools focus on support, resistance, or breakout alerts.
This script was built for a different question: what happens inside the range before price reaches the edge?
It helps traders review whether price is still trapped around equilibrium or beginning a clean rotation from the midpoint toward the upper or lower edge.
⚡ Why This Script Is Different
Most range indicators draw a box and wait for a breakout.
This script does NOT center the workflow on range escape.
Instead, it evaluates range maturity, midpoint control, rotation quality, edge room, and failure back through equilibrium. The goal is rotation planning, not breakout prediction.
⚙️ Methodology
1. Range Maturity Detection
The script builds a rolling range using recent high and low structure, then checks whether the height and edge interactions are meaningful.
2. Equilibrium Mapping
The midpoint band is calculated around the center of the range and becomes the key control zone.
3. Rotation Evaluation
Price must move away from equilibrium with enough buffer before directional rotation is considered active.
4. Risk / Room Structure
The active edge becomes the room reference, while the opposite side of equilibrium becomes the failure area.
5. Visual Output
The chart receives a range box, equilibrium band, edge rails, room rail, failure rail, labels, right-side tags, optional bar coloring, and dashboard panel.
🗺️ How to Read the Chart
The range box marks the current high-to-low structure.
The equilibrium band shows the midpoint area where rotation control is evaluated.
The upper and lower rails mark the active range edges.
The room rail marks the edge being targeted by the active rotation.
The failure rail marks where rotation has moved back through the wrong side of equilibrium.
Labels highlight mature ranges, rotations from midpoint, equilibrium holds, edge reviews, and failed rotations.
Colors represent context:
• Teal → bullish rotation
• Pink → bearish rotation or failure
• Gold → equilibrium, room, or edge review
• Indigo → range structure or waiting context
The panel summarizes:
• Range
• Rotation Score
• Balance
• Room
• Action
🚦 Signals & States
• Range Ready → a mature range structure is available
• Bull Rotation → price rotated upward from equilibrium
• Bear Rotation → price rotated downward from equilibrium
• Midpoint Hold → price remains controlled by the equilibrium band
• Edge Review → price reached the active range edge
• Failed → rotation moved back through the failure rail
• READY → rotation quality and room are strong enough to monitor
• MONITOR → rotation is active but not fully ready
• WAIT RANGE → no mature range exists
• WAIT ROTATION → range exists but no clean rotation has started
🔔 Alerts Logic
Alerts can trigger when a mature range appears, when bullish or bearish rotation begins, when READY state appears, when midpoint hold appears, when an edge is reached, or when the rotation fails.
Alerts are attention markers only. They are not trade instructions.
🧩 Confluence Logic
The context becomes stronger when range maturity, balanced edge interaction, midpoint departure, edge room, and failure distance align.
The script avoids treating midpoint noise as a clean rotation without confirmation.
📊 When to Use
• Sideways markets with visible range structure
• Crypto, forex, indices, and liquid stocks
• 1H, 4H, and 1D market structure review
• Mean-reversion planning inside a range
• Range edge preparation without waiting for breakout-only logic
⚠️ When NOT to Use
• Strong one-directional trends with no range structure
• Thin symbols with unreliable highs and lows
• News-driven candles that distort range boundaries
• Very small ranges where spread or tick noise dominates
• Markets with unstable data or irregular sessions
🎛️ Key Inputs
• Range Lookback → controls the structure used to build the range
• Minimum / Maximum Range Height ATR → filters ranges that are too small or too wide
• Edge Touch Tolerance → controls how edge interactions are counted
• Equilibrium Band ATR → controls midpoint band width
• Rotation Break Buffer → controls how far price must move beyond equilibrium
• Minimum Ready Score → controls READY strictness
• Projection Bars → controls how far boxes, rails, and tags extend
• Visual settings → control labels, tags, panel location, theme, and font size
🖥️ Interface & Visual Design
The panel is designed to show the range state, rotation quality, balance, room, and action without overloading the chart.
The first row uses a merged AG Pro header. The chart layer keeps the range and equilibrium structure visible while leaving room for price action.
Labels are controlled with cooldown and maximum count settings to preserve a premium screenshot style.
🧪 Practical Usage Workflow
1. Read the panel.
2. Confirm a mature range exists.
3. Check whether price is still at equilibrium or rotating away.
4. Review room to the active edge.
5. Watch the failure rail if rotation loses control.
🔍 Interpretation Guidelines
A high score means range maturity, midpoint departure, and edge room are aligned.
A midpoint hold means equilibrium is still controlling the auction.
An edge review means the rotation has reached the active range edge and should be interpreted as context, not as an automatic exit.
A failed state means the active rotation moved back through its failure boundary.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not financial advice.
It is not an automated trading system.
It does not place orders.
It does not guarantee edge reach, reversal, breakout, or profitability.
⚠️ Limitations & Transparency
Range boundaries can shift as new highs or lows appear.
Different timeframes may show different range structures.
Large volatility events can temporarily distort range height and edge touch quality.
Low liquidity may create unreliable equilibrium or edge behavior.
The script is rule-based and should be interpreted within broader market context.
🧠 Market Context Notes
Equilibrium is often where the market decides whether price will rotate toward an edge or remain balanced.
The strongest rotation contexts usually appear when price leaves midpoint with room, while failure remains clearly defined.
This script is designed to make that inside-range decision point easier to read.
🧾 Use Case Examples
When price holds near midpoint and then closes above the equilibrium band, the script can begin tracking bullish rotation toward the upper range edge.
When price rotates downward from equilibrium and reaches the lower edge, the context shifts into edge review rather than fresh entry signaling.
When price moves back through the failure rail, the active rotation context fails.
🧱 System Philosophy
AGPro Series tools are built as decision-support systems.
They aim to convert market structure into readable context: what is active, what improves the plan, what invalidates it, and what should be reviewed next.
🔐 Non-Promise Statement
No script can provide certainty.
No signal guarantees outcome.
This tool provides structured context only.
📉 Risk Disclosure
Trading involves risk.
Markets can move quickly and unexpectedly.
Users are responsible for their own analysis, risk management, and decisions.
This script does not provide financial advice.
📚 Educational Note
Use this tool to study how range equilibrium, midpoint control, rotation quality, and edge room interact across different symbols and timeframes.
Release Notes
🔧 UPDATE NOTES - VERSION 1.4This update focuses on restoring publication strength, active structure continuity, chart readability, and state-aligned panel output.
The core purpose of the script remains unchanged.
This release corrects an overly aggressive cleanup approach from the prior revision and restores the stronger visual planning profile.
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
------------------------
• Restored active rotation structure continuity.
Locked range boxes, equilibrium bands, edge-room rails, and failure rails can now remain visible through the rotation review window even if the newest rolling range is no longer mature.
• Added Keep Active Rotation Structure.
This setting controls whether active rotation visuals stay alive after the original range is locked, preserving the planning story that made the original publication view stronger.
• Re-aligned panel state with active rotations.
When a rotation is still active, the panel prioritizes Bull Rotation or Bear Rotation instead of collapsing too quickly into No Range.
• Restored stronger default chart presence.
Edge Review labels remain enabled by default, historical label count was raised, and event memory was extended to keep the chart from feeling empty.
• Preserved the cleaner badge and panel improvements from Version 1.2.
Separate centered badges, compact right-side tags, and expanded panel theme support remain in place.
------------------------
Visual Improvements
------------------------
• Restores a stronger publication-style range box and projected planning structure.
• Keeps edge-room and failure references visible while the active rotation context is still relevant.
• Improves first-glance storytelling compared with the overly sparse prior revision.
• Maintains cleaner zone badges without returning to low-contrast embedded box text.
------------------------
Interface & Usability
------------------------
• Added a dedicated control for active rotation structure persistence.
• Kept panel show/hide, panel location, theme, and font-size controls unchanged.
• Kept label font-size and label spacing controls available for publication tuning.
• Preserved compact right-side tag behavior for cleaner chart screenshots.
------------------------
Behavior Notes
------------------------
This update does not change the purpose of the range equilibrium rotation engine.
The goal is to restore visual continuity and avoid removing useful active planning context too early.
Users should interpret outputs as analytical context markers, not as predictive instructions.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Market conditions such as volatility, liquidity, range width, and timeframe differences may affect how rotation 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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Public-free and invite-only TradingView Pine Script tools for market analysis, risk planning, liquidity and execution review.
Script library & access: aligurtuna.com/agprolabs-pine-scriptleri/
Telegram: t.me/agprolabs
Script library & access: aligurtuna.com/agprolabs-pine-scriptleri/
Telegram: t.me/agprolabs
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Public-free and invite-only TradingView Pine Script tools for market analysis, risk planning, liquidity and execution review.
Script library & access: aligurtuna.com/agprolabs-pine-scriptleri/
Telegram: t.me/agprolabs
Script library & access: aligurtuna.com/agprolabs-pine-scriptleri/
Telegram: t.me/agprolabs
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.