OPEN-SOURCE SCRIPT
Directional Movement Index - DMI

🎯 Overview
This is a versatile Directional Movement Index (DMI) indicator that provides multiple visualization modes for analyzing trend strength and direction. Unlike traditional DMI displays, this version offers three different viewing options and focuses on DI crossover signals for clear trend identification.
🧩 Core Components
1. ⚙️ Technical Foundation
📊 Primary Calculation: Uses TradingView's built-in ta.dmi() function
📈 Three Core Components:
+DI (Positive Directional Indicator): Measures upward movement strength
-DI (Negative Directional Indicator): Measures downward movement strength
ADX (Average Directional Index): Measures overall trend strength
⚡ Dynamic Average: Creates a composite line (+DI minus -DI) for simplified analysis
2. 🎛️ Configuration Parameters
📏 DMI Length: Default 8 periods (standard setting)
🔄 ADX Smoothing: Additional smoothing for ADX line
🎨 Color Themes: 5 visual schemes consistent with your indicator suite
👁️ Display Toggles:
Average DMI: Shows composite line (+DI minus -DI)
DMI: Shows individual +DI and -DI lines
ADX Smoothing: Shows ADX trend strength line
📈 Signal Interpretation:
🟢 BULLISH: +DI > -DI (upward momentum stronger)
🔴 BEARISH: -DI > +DI (downward momentum stronger)
🎨 Visual Elements:
🚨 Signal Highlights: Background coloring on DI crossovers
📋 Line Labels: On-chart labels for each indicator component
📊 Table Display: Top-right bullish/bearish status indicator
📋 Dashboard Display:
Content: "⬆️ Bullish" or "⬇️ Bearish" based on DI relationship
⚡ Trading Applications
📈 Primary Uses:
🎯 Trend Direction Identification
+DI > -DI = Uptrend
-DI > +DI = Downtrend
💪 Trend Strength Assessment
ADX > 25 = Valid trend (tradable)
ADX < 25 = Weak trend (avoid trading)
ADX rising = Strengthening trend
🚨 Crossover Signals
Bull Crossover: +DI crosses above -DI
Bear Crossover: -DI crosses above +DI
🎨 Customization Options
👁️ Display Flexibility:
📊 Mode 1: Simplified (Average DMI only)
📈 Mode 2: Detailed (+DI and -DI lines)
💪 Mode 3: Strength-focused (ADX line)
🔄 Any Combination: Mix and match as needed
🎨 Visual Themes: (Consistent suite)
🎨 Classic: Green/Red (traditional directional colors)
🚀 Modern: Cyan/Purple (contemporary)
💪 Robust: Amber/Deep Purple (high contrast)
🌈 Accented: Purple/Magenta (vibrant)
⚫⚪ Monochrome: Light Gray/Dark Gray (minimalist)
🔔 Alert System
🟢 LONG Alert: Triggers when +DI crosses above -DI
🔴 SHORT Alert: Triggers when -DI crosses above +DI
📧 Format: Includes ticker symbol for tracking
⚡ Key Advantages
✅ Strengths:
🎯 Multiple Perspectives: Three display modes in one indicator
📊 Clear Trend Signals: DI crossovers provide unambiguous entries/exits
💪 Strength Filter: ADX helps avoid trading in weak trends
👁️ Visual Clarity: Color-coded and labeled for easy interpretation
🔄 Flexible Usage: Can be simple or detailed based on trader preference
📊 Optimal Settings:
⚡ Short-term Trading: 8-14 period length
📊 Medium-term Trading: 14-20 period length
📈 Long-term Trading: 20-50 period length
🎯 ADX Smoothing: Higher values for smoother trend strength
🏆 Unique Features:
Mode Selector: Choose your preferred view (simple → detailed)
Composite Average: (+DI - -DI) creates single directional line
Strength Integration: Built-in ADX for trend validation
Visual Harmony: Consistent design with your indicator family
Professional Labels: On-chart annotations for clarity
This DMI indicator provides professional-grade trend analysis with user-friendly flexibility, allowing traders from beginners to experts to customize their view according to their trading style and experience level! 📊🎯
This is a versatile Directional Movement Index (DMI) indicator that provides multiple visualization modes for analyzing trend strength and direction. Unlike traditional DMI displays, this version offers three different viewing options and focuses on DI crossover signals for clear trend identification.
🧩 Core Components
1. ⚙️ Technical Foundation
📊 Primary Calculation: Uses TradingView's built-in ta.dmi() function
📈 Three Core Components:
+DI (Positive Directional Indicator): Measures upward movement strength
-DI (Negative Directional Indicator): Measures downward movement strength
ADX (Average Directional Index): Measures overall trend strength
⚡ Dynamic Average: Creates a composite line (+DI minus -DI) for simplified analysis
2. 🎛️ Configuration Parameters
📏 DMI Length: Default 8 periods (standard setting)
🔄 ADX Smoothing: Additional smoothing for ADX line
🎨 Color Themes: 5 visual schemes consistent with your indicator suite
👁️ Display Toggles:
Average DMI: Shows composite line (+DI minus -DI)
DMI: Shows individual +DI and -DI lines
ADX Smoothing: Shows ADX trend strength line
📈 Signal Interpretation:
🟢 BULLISH: +DI > -DI (upward momentum stronger)
🔴 BEARISH: -DI > +DI (downward momentum stronger)
🎨 Visual Elements:
🚨 Signal Highlights: Background coloring on DI crossovers
📋 Line Labels: On-chart labels for each indicator component
📊 Table Display: Top-right bullish/bearish status indicator
📋 Dashboard Display:
Content: "⬆️ Bullish" or "⬇️ Bearish" based on DI relationship
⚡ Trading Applications
📈 Primary Uses:
🎯 Trend Direction Identification
+DI > -DI = Uptrend
-DI > +DI = Downtrend
💪 Trend Strength Assessment
ADX > 25 = Valid trend (tradable)
ADX < 25 = Weak trend (avoid trading)
ADX rising = Strengthening trend
🚨 Crossover Signals
Bull Crossover: +DI crosses above -DI
Bear Crossover: -DI crosses above +DI
🎨 Customization Options
👁️ Display Flexibility:
📊 Mode 1: Simplified (Average DMI only)
📈 Mode 2: Detailed (+DI and -DI lines)
💪 Mode 3: Strength-focused (ADX line)
🔄 Any Combination: Mix and match as needed
🎨 Visual Themes: (Consistent suite)
🎨 Classic: Green/Red (traditional directional colors)
🚀 Modern: Cyan/Purple (contemporary)
💪 Robust: Amber/Deep Purple (high contrast)
🌈 Accented: Purple/Magenta (vibrant)
⚫⚪ Monochrome: Light Gray/Dark Gray (minimalist)
🔔 Alert System
🟢 LONG Alert: Triggers when +DI crosses above -DI
🔴 SHORT Alert: Triggers when -DI crosses above +DI
📧 Format: Includes ticker symbol for tracking
⚡ Key Advantages
✅ Strengths:
🎯 Multiple Perspectives: Three display modes in one indicator
📊 Clear Trend Signals: DI crossovers provide unambiguous entries/exits
💪 Strength Filter: ADX helps avoid trading in weak trends
👁️ Visual Clarity: Color-coded and labeled for easy interpretation
🔄 Flexible Usage: Can be simple or detailed based on trader preference
📊 Optimal Settings:
⚡ Short-term Trading: 8-14 period length
📊 Medium-term Trading: 14-20 period length
📈 Long-term Trading: 20-50 period length
🎯 ADX Smoothing: Higher values for smoother trend strength
🏆 Unique Features:
Mode Selector: Choose your preferred view (simple → detailed)
Composite Average: (+DI - -DI) creates single directional line
Strength Integration: Built-in ADX for trend validation
Visual Harmony: Consistent design with your indicator family
Professional Labels: On-chart annotations for clarity
This DMI indicator provides professional-grade trend analysis with user-friendly flexibility, allowing traders from beginners to experts to customize their view according to their trading style and experience level! 📊🎯
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.
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.
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.