OPEN-SOURCE SCRIPT
Updated

AG Pro DMI Rotation Pressure [AGPro Series]

910
AG Pro DMI Rotation Pressure [AGPro Series]

Overview / What it does

AG Pro DMI Rotation Pressure is designed to track directional leadership shifts between +DI and -DI rather than treating DMI as a simple trend-strength confirmation tool. The script focuses on which side is gaining control, how decisively that control is expanding, and whether the current condition reflects rotation, compression, drift, or established directional pressure.

The indicator is plotted in a separate pane so the rotational structure can be read clearly without interfering with price structure on the main chart. It combines a net pressure histogram, a pressure signal line, DI spread behavior, rotation bursts, and compression tension into one framework intended to make directional handoffs easier to interpret.

This script is intentionally different from strength-oriented DMI or ADX studies. In many DMI-based tools, ADX becomes the main story. Here, ADX is only a supporting context value. The primary objective is to monitor the push-and-pull between +DI and -DI, especially when leadership is unstable, when pressure begins to build after compression, or when one side starts to hold directional control more consistently.

For traders who want to study internal directional pressure before or during trend development, this script is built to highlight control transitions rather than just reporting whether a trend is already strong.

Unique Edge

The distinctive feature of this script is its emphasis on rotational pressure instead of trend-strength ranking. Rather than asking only whether the market is strong, it asks which side is taking control, whether that control is improving or fading, and whether a transition is underway.

This produces a different read from a standard ADX workflow. A market can have moderate ADX and still show meaningful bullish or bearish pressure transfer through the behavior of +DI and -DI. Conversely, a market may print elevated ADX while the directional leadership structure is already weakening or becoming unstable. By separating directional leadership from raw strength, the script aims to expose the internal character of the move more clearly.

The script also classifies the environment into readable states such as Bull Rotation, Bear Rotation, Bull Control, Bear Control, Bull Expansion, Bear Expansion, Bull Drift, Bear Drift, and Compression Battle. That state engine is meant to reduce ambiguity and make the pane easier to interpret quickly across multiple symbols and timeframes.

Methodology

The script begins with the DMI framework: +DI, -DI, and ADX. From there, it derives a rotational model built around DI spread and spread behavior over time.

1. DI leadership
The core directional read is the spread between +DI and -DI. Positive spread means bullish directional leadership. Negative spread means bearish directional leadership. The magnitude of that spread is used as one layer of directional pressure assessment.

2. Rotational slope behavior
The script evaluates how +DI and -DI are changing, not only their absolute values. This helps estimate whether one side is accelerating relative to the other. Slope behavior is important because leadership transitions often begin before a large DI spread is fully established.

3. Pressure scoring
Bullish and bearish pressure are scored separately using DI spread, relative slope behavior, and spread momentum. This creates the Bull / Bear pressure readings shown in the panel, as well as the Net Pressure histogram in the pane.

4. Signal smoothing
A pressure signal line is applied to the net pressure series to make pressure drift and bias easier to read. This is not intended as a prediction line. It is a smoothing layer that helps frame whether the dominant side is strengthening, fading, or remaining relatively stable.

5. Rotation bursts
Crossovers between +DI and -DI are treated as potential rotational events. The script scores those events so that rotation markers are tied to directional handoff rather than appearing as purely cosmetic crossover labels.

6. Compression and tension
When DI spread contracts below the compression threshold, the script evaluates internal tension. This is useful because some of the most meaningful directional expansions begin after a compressed and contested leadership state. Compression Battle is meant to identify that contested environment, not to forecast direction by itself.

7. State engine
The script assigns a readable state based on pressure, spread, crossover status, and compression context. This is what allows the study to describe the environment as rotation, control, expansion, drift, or compression instead of leaving the user to infer all conditions from raw lines alone.

Signals & Alerts

The script includes deterministic alert conditions for the following events:

Bull Rotation
Triggered when +DI crosses above -DI and bullish directional rotation takes control.

Bear Rotation
Triggered when +DI crosses below -DI and bearish directional rotation takes control.

Bull Control
Triggered when bullish pressure is in control territory.

Bear Control
Triggered when bearish pressure is in control territory.

Compression Battle
Triggered when DI spread is compressed while internal tension is elevated.

These conditions are designed to describe state changes inside the DMI structure. They should be used as analytical events, not as automatic trade instructions.

Key Inputs

DI Length
Controls the base DMI sensitivity.

ADX Smoothing
Adjusts the ADX smoothing component used for contextual strength reading.

Rotation Slope Smoothing
Changes how quickly slope-based rotational behavior reacts.

Pressure Signal Length
Controls smoothing of the net pressure signal.

Compression Threshold
Defines when DI spread is considered compressed.

Expansion Threshold
Defines when directional pressure begins to qualify as expansion.

Control Threshold
Defines when directional pressure is strong enough to be treated as control.

Visual controls
Backgrounds, spread fill, rotation markers, panel theme, panel position, and panel font size can all be adjusted depending on the chart style and workspace preference.

Limitations & Transparency

This script is not a forecasting model. It does not know future direction and it does not attempt to predict exact reversal points. It is a structural pressure tool built from DMI behavior.

Like all DMI-based studies, it can become noisy in highly erratic or mean-reverting conditions. Repeated +DI and -DI handoffs may appear during choppy phases, especially on lower timeframes or during indecisive sessions.

Compression readings should not be interpreted as guaranteed breakout setups. Compression only describes a tight directional contest inside the DI structure. Direction still needs confirmation from price behavior, market structure, volatility regime, or other contextual tools.

Bullish or bearish control states do not guarantee continuation. They only indicate that the directional pressure model currently favors one side. Users should evaluate the output alongside price structure, support/resistance, volume behavior, and timeframe context.

This study is best treated as a directional pressure map, not as a standalone trading system.

Risk Disclosure

This script is for chart analysis and research purposes only. It does not provide financial, investment, or trading advice. Markets involve risk, and indicator-based decisions can result in losses. Always use independent judgment, confirm with broader market context, and apply appropriate risk management.
Release Notes
UPDATE NOTES - V1.2

This update is primarily focused on visual refinement, panel readability, and presentation quality. The goal was to improve chart-facing clarity and make the script easier to read at a glance, without changing its underlying DMI rotation-pressure framework or its documented alert semantics.

What changed

• Added a Visual Style selector with Premium and Classic modes.
This allows a cleaner default presentation while preserving a simpler fallback style for users who prefer a lighter visual footprint.

• Added an optional State Ribbon.
A thin upper ribbon now provides faster visual context for the active regime without introducing additional signal complexity.

• Added an optional Signal Cloud.
This improves separation between positive and negative pressure context and gives the pressure signal a more coherent visual anchor.

• Refined the Leader Ribbon presentation.
The ribbon and edge treatment were adjusted to look cleaner and more controlled, especially during transitions between +DI and -DI leadership.

• Improved Premium-mode marker presentation.
Rotation markers now read more clearly in Premium mode while remaining compact and non-intrusive.

• Rebalanced background emphasis.
Compression and control backgrounds were softened so the script remains readable without overwhelming the panel or the plotted pressure structure.

• Reworked the Summary Panel styling.
Header hierarchy, row contrast, and metric/background balance were refined to improve legibility and give the panel a more polished visual structure.

• Improved State-row contrast.
Compression-state readability was specifically adjusted so the active state remains clear under both dark and light visual conditions.

• Simplified the Bull / Bear row presentation.
The row now uses a single right-side value field for a cleaner, more consistent table layout.

• Fixed Bull / Bear numeric formatting.
Numeric display formatting was corrected so zero values render cleanly and consistently.

What did not change

• No change to the core DMI, DI spread, slope, pressure, tension, or ADX calculations.
• No change to the documented Bull Rotation, Bear Rotation, Bull Control, Bear Control, or Compression Battle alert conditions.
• No change to the script’s core purpose.
This remains a rotation-pressure mapping tool designed to organize directional pressure, compression, and leadership context inside the DMI structure. It is not presented as a prediction engine or a standalone trade-decision system.

Summary

V1.2 is a presentation-focused upgrade. It improves readability, visual hierarchy, and chart appeal while preserving the same rules-based analytical structure and the same documented alert behavior.
Release Notes
Update Notes - V1.4

This update focuses on visual refinement, signal presentation discipline, and panel consistency.

• Refined rotation label filtering to reduce visual crowding.
• Increased spacing between consecutive rotation markers to avoid repeated clustering.
• Improved label placement logic so bullish and bearish markers stay cleaner inside the pane.
• Made rotation markers more selective to emphasize stronger events and reduce weaker repeats.
• Standardized the summary panel header with the current AG Pro layout approach.
• Adjusted default panel readability settings for a cleaner first-load presentation.
• Fine-tuned the balance between pressure columns, spread visuals, signal lines, and compression context.
• Applied additional visual cleanup for a more consistent and readable structure.

This script remains an analytical tool for reading directional pressure, DI leadership shifts, and compression behavior.
It does not predict future price movement and should not be treated as financial advice.
Release Notes
Update Notes - V1.5

This update is designed to make DMI Rotation Pressure more chart-worthy on first glance while keeping the script focused on one specific job: reading leadership transfer inside the DMI structure.

What changed

- Removed the leading `AG Pro` prefix from the public script title to align the series naming standard while keeping `AG Pro` inside the panel header only.
- Reworked the settings experience with professional English tooltips across the full input set.
- Added `Control Shelves` to box sustained bull and bear control phases directly inside the pane.
- Added `Compression Windows` to highlight persistent squeeze conditions when DMI spread stays tight and internal tension builds.
- Tightened default rotation-label discipline with stronger score thresholds, wider spacing, and added vertical offset control.
- Upgraded label and panel defaults to `Normal` font sizing for a cleaner premium first-load presentation.
- Rebuilt the panel so theme and corner-position changes are handled more reliably while preserving the merged blue AG Pro header row.
- Rebalanced colors around the AGPro palette to improve hierarchy without making the pane feel crowded.

What did not change

- The core DMI engine still revolves around +DI versus -DI leadership, DI spread, pressure balance, and compression tension.
- The script still treats ADX as supporting context rather than the main story.
- Existing alert intent remains the same: Bull Rotation, Bear Rotation, Bull Control, Bear Control, and Compression Battle.

Why this update is distinct

This script remains narrower than a generic ADX strength study, narrower than a market-regime classifier, and narrower than a relative-strength rotation tool. Its job is still to map handoff quality inside the DMI structure itself: who is taking control, how cleanly control is forming, and whether compression is turning into directional pressure.
Release Notes
UPDATE NOTES - v1.6

This update focuses on decision clarity and panel usability.

The core purpose of the script remains unchanged.
This release improves how the existing DMI rotation, pressure, and compression
logic is presented and interpreted on the chart.

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

- Next Action readout
The summary panel now leads with a plain-language Next Action line that
translates the current rotation state into a single suggested response (for
example Long Setup - Fresh Rotation, Follow Long - Pressure Rising, Hold Short
- Bears in Control, Watch Long - Lead Unconfirmed, Stand Aside - Coiling, or
Wait - No Clear Pressure). It turns the existing state machine and pressure
scores into a clear at-a-glance read of how the directional auction is
behaving right now, instead of leaving the reader to assemble the picture from
separate rows.

- Decision-ladder phrasing
The action wording follows a consistent escalation that mirrors the internal
states: a fresh DI handoff reads as a Setup, building pressure reads as
Follow, established dominance reads as Hold, a weak unconfirmed lead reads as
Watch, and a compressed standoff reads as Stand Aside. This keeps the guidance
honest about how committed the current rotation actually is.

- Adaptive panel contrast
The Next Action cell uses a luminance-aware text color so it stays crisp and
readable on both the Dark and Light panel themes.

- Naming alignment
The on-chart short title now follows the standard AG Pro naming format for a
more consistent look in the indicator legend.


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

- Improved first-glance interpretation by surfacing the most actionable
information at the very top of the panel.

- Refined visual hierarchy so the suggested response stands out clearly above
the supporting metrics.

- Kept the rotation labels, ribbons, and pressure shelves at their existing
balanced density to preserve a premium, uncluttered pane.


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

- Optimized panel layout for clearer information flow from action to context.

- Improved label readability inside the panel across both themes.

- Enhanced overall user experience without changing core logic.


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

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

The DMI rotation, pressure scoring, compression, and shelf engines behave
exactly as before. The Next Action line is a readability layer built directly on
top of the existing state machine.

Users should interpret outputs the same way as before, now with a clearer
summary of the current rotational context.


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may
affect how rotations and pressure phases 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
Version 1.7 - Exclusive Rotation Ownership

This update separates medium rotation markers, strong rotation badges, and active pressure structures into exclusive visual roles while preserving the DMI engine, pressure scoring, compression logic, panel metrics, and five alert conditions.

- Raised the default marker and badge thresholds, added a 36-bar global badge cooldown, and capped combined bull and bear history at five labels.

- Prevented the same rotation event from printing both a triangle marker and a strong rotation badge.

- Converted rotation badges to compact single-line BULL ROT or BEAR ROT output with quality scores and shared Normal font sizing.

- Replaced persistent unlabeled shelf history with one lifecycle-owned active Bull Control, Bear Control, or Compression structure.

- Added one filled direction-and-pressure or tension badge centered horizontally and vertically inside every active shelf or compression window.

- Removed the standalone pane background tint and reduced label and box object budgets without changing the analytical state engine.

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.