OPEN-SOURCE SCRIPT
ATK / DEF Directional Movement State Engine

Description
ATK / DEF Directional Movement State Engine is a market condition analysis framework built around the Directional Movement Index (DMI) system.
Unlike traditional DMI tools that mainly display +DI, -DI, and ADX values, this indicator focuses on interpre the effectiveness and current condition of directional movement through multiple analytical layers.
The engine combines directional strength, trend structure, volatility behavior, and price action characteristics to provide a structured view of market conditions.
The purpose of this framework is to evalu the qual of directional movement and understand the current state of market behavior.
Directional Movement Core
The foundation of this indicator is based on the DMI and ADX framework.
It analyzes:
+DI directional pressure
-DI directional pressure
ADX directional strength
The relationship between these components is used to class the current movement environment, including:
Strong directional conditions
Weak directional conditions
Balanced movement
Swinging conditions
Rather than focusing on a single numeri rea, the engine evalua how directional components interact with the broader market structure.
ATK / DEF Market State Concept
The ATK / DEF framework represents two different market behaviors.
ATK (Attack State)
Describes environments where directional movement demonstrates stronger activity and clearer momentum characteristics.
DEF (Defense State)
Describes environments where directional movement becomes weaker, balanced, or less defined.
The engine observes these states through directional strength, price structure, and movement behavior to describe the current market condition.
Directional Radar System
The Radar module analyzes current price behavior by combining candle structure and market movement characteristics.
It evaluates:
Candle body efficiency
Price range behavior
Directional pressure
Trend positioning
Short-term movement characterist
The radar provides a visual representation of the current behavioral condition, helping use understand whether the market is displaying expansion, decline, compression, or swing characteristics.
Trend Structure Analysis
The trend module evaluates market structure through multiple moving average relationships and price positioning.
It observes:
Short- trend direction
Medium-alignment
Long- structural condition
This provides additional context for understanding the relationship between directional movement and the overall price structure.
Velocity Measurement
The Velocity component measures current movement intensit through volatility conditions.
It evalua price movement range relative to recent market activity to describe different leve of movement speed.
This helps identify whether the current environment is experiencing:
Lower activity conditions
Normal movement conditions
Higher volatility conditions
Market Regime Observation
The Regime module evaluates changes in market activity using volatility structure.
It observes:
Expansion conditions
Contraction conditions
Range environments
This provides additional context around how the market is currently behaving.
ADX State Classification
The ADX state engine combines ADX strength with DI relationships to categorize directional conditions.
The classification includes:
Strong U
Strong D
Weak U
Weak D
Swing Condition
These states are designed to describe the current directional environment rather than forecast future market movement.
Integrated Dashboard
The built-in dashboard organizes multiple analytical components into a single view:
Engine status
Velocity level
Radar condition
Trend direction
Market regime
ADX state
Current price information
The dashboard provides a compact overview of market structure and directional behavior.
Design Philosophy
ATK / DEF Directional Movement State Engine is designed around the concept that market movement should be analyzed through multiple layers rather than a single indicator value.
By combining:
Directional movement analysis
ADX strength evaluation
Trend structure
Volatility behavior
Price action characteristics
the indicator provides a structured framework for observing market conditions and understanding directional movement effectiveness.
This tool is designed for analytical purposes, helping users stu market behavior, movement structure, and directional dynamics.
ATK / DEF Directional Movement State Engine is a market condition analysis framework built around the Directional Movement Index (DMI) system.
Unlike traditional DMI tools that mainly display +DI, -DI, and ADX values, this indicator focuses on interpre the effectiveness and current condition of directional movement through multiple analytical layers.
The engine combines directional strength, trend structure, volatility behavior, and price action characteristics to provide a structured view of market conditions.
The purpose of this framework is to evalu the qual of directional movement and understand the current state of market behavior.
Directional Movement Core
The foundation of this indicator is based on the DMI and ADX framework.
It analyzes:
+DI directional pressure
-DI directional pressure
ADX directional strength
The relationship between these components is used to class the current movement environment, including:
Strong directional conditions
Weak directional conditions
Balanced movement
Swinging conditions
Rather than focusing on a single numeri rea, the engine evalua how directional components interact with the broader market structure.
ATK / DEF Market State Concept
The ATK / DEF framework represents two different market behaviors.
ATK (Attack State)
Describes environments where directional movement demonstrates stronger activity and clearer momentum characteristics.
DEF (Defense State)
Describes environments where directional movement becomes weaker, balanced, or less defined.
The engine observes these states through directional strength, price structure, and movement behavior to describe the current market condition.
Directional Radar System
The Radar module analyzes current price behavior by combining candle structure and market movement characteristics.
It evaluates:
Candle body efficiency
Price range behavior
Directional pressure
Trend positioning
Short-term movement characterist
The radar provides a visual representation of the current behavioral condition, helping use understand whether the market is displaying expansion, decline, compression, or swing characteristics.
Trend Structure Analysis
The trend module evaluates market structure through multiple moving average relationships and price positioning.
It observes:
Short- trend direction
Medium-alignment
Long- structural condition
This provides additional context for understanding the relationship between directional movement and the overall price structure.
Velocity Measurement
The Velocity component measures current movement intensit through volatility conditions.
It evalua price movement range relative to recent market activity to describe different leve of movement speed.
This helps identify whether the current environment is experiencing:
Lower activity conditions
Normal movement conditions
Higher volatility conditions
Market Regime Observation
The Regime module evaluates changes in market activity using volatility structure.
It observes:
Expansion conditions
Contraction conditions
Range environments
This provides additional context around how the market is currently behaving.
ADX State Classification
The ADX state engine combines ADX strength with DI relationships to categorize directional conditions.
The classification includes:
Strong U
Strong D
Weak U
Weak D
Swing Condition
These states are designed to describe the current directional environment rather than forecast future market movement.
Integrated Dashboard
The built-in dashboard organizes multiple analytical components into a single view:
Engine status
Velocity level
Radar condition
Trend direction
Market regime
ADX state
Current price information
The dashboard provides a compact overview of market structure and directional behavior.
Design Philosophy
ATK / DEF Directional Movement State Engine is designed around the concept that market movement should be analyzed through multiple layers rather than a single indicator value.
By combining:
Directional movement analysis
ADX strength evaluation
Trend structure
Volatility behavior
Price action characteristics
the indicator provides a structured framework for observing market conditions and understanding directional movement effectiveness.
This tool is designed for analytical purposes, helping users stu market behavior, movement structure, and directional dynamics.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。