OPEN-SOURCE SCRIPT

Directional Movement Index - DMI

30
🎯 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! 📊🎯

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。