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! 📊🎯
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.