Directional Movement Index
systemic:core-dmiIndicatorsInputs
| Name | Type | Description |
|---|---|---|
| Window | Whole number | The number of bars (e.g., 14) over which the DMI values are smoothed. |
| Price High | Number series | The highest price of the asset for each bar. |
| Price Low | Number series | The lowest price of the asset for each bar. |
| Price Close | Number series | The closing price of the asset for each bar. |
Outputs
| Name | Type | Description |
|---|---|---|
| Dmi | Number series | The Directional Index (DX): the strength of the trend from 0 to 100, whatever its direction. |
| +DI | Number series | The strength of upward price movement, from 0 to 100. |
| -DI | Number series | The strength of downward price movement, from 0 to 100. |
Cost
0.2 + 0.0174·n credits for n bars, rounded up. The marks are each plan's limit of bars.
Overview
The Directional Movement Index (DMI), developed by J. Welles Wilder Jr., is a classic technical analysis tool for measuring the strength and direction of market trends. DMI is widely used in both traditional securities (stocks, ETFs, futures) and cryptocurrencies to tell trending markets from ranging ones and to generate signals. It has three main elements:
- +DI (Positive Directional Indicator): Measures upward trend strength
- -DI (Negative Directional Indicator): Measures downward trend strength
- DX (Directional Index): Measures trend strength at the current bar, whatever the direction. This is the module's third output. The ADX is a further-smoothed DX (a moving average of DX over the window); this module does not output it.
DMI is often used together with other indicators (e.g., Average True Range (ATR), Moving Averages) to refine entries and exits. For a historical perspective, see Wilder's original work.
Mathematical Formulation
The DMI calculation has several steps that smooth price movements to filter out noise. The key formulas are:
1. True Range (TR)
True Range is the widest of the bar's own range and the gap from the previous bar's Close:
When the previous bar's Close is missing (for example a gap in the Close series), TR is the bar's own High − Low range. A missing Close never makes a bar empty.
2. Directional Movements
If and , use ; else 0. If and , use ; else 0.
3. Smoothed Values
Apply Wilder's smoothing over the window (usually 14 bars):
(similar for and )
4. Directional Indicators
5. Directional Index (DX) and ADX
Visualizing DMI
Calculation Flow
flowchart TD
A[Price Data] --> B[Calculate TR, +DM, -DM]
B --> C[Apply Smoothing]
C --> D[Compute +DI, -DI]
D --> E[Calculate DX]
E --> G[DMI Output: +DI, -DI, DX]
Signal Generation Workflow
sequenceDiagram
participant Market
participant DMI
participant Trader
Market->>DMI: Price data
DMI->>DMI: Compute +DI, -DI, DX
DMI->>Trader: Signal (+DI cross, -DI cross, DX > 25)
Trader->>Market: Decide to trade or hold
Practical Use Cases
In Securities
- Trend Confirmation: DMI helps confirm if a stock is in a strong uptrend or downtrend, filtering out sideways markets.
- Entry/Exit Signals: Crossovers of +DI and -DI, especially when ADX is above a threshold (commonly 20 or 25), are used for entries and exits.
- Volatility Regimes: ADX rising signals strengthening trends, while falling ADX warns of choppy/range-bound conditions.
In Cryptocurrencies
- Volatility Adaptation: Crypto markets are highly volatile; DMI can help avoid false breakouts by requiring ADX confirmation.
- Risk Management: During high ADX periods, traders may increase position size; during low ADX, reduce risk or avoid trading.
DMI in Macroeconomic Context
DMI is most useful when combined with macro indicators such as CPI, VIX, and interest rates. For example, in a high-inflation, high-volatility regime, DMI can help filter out false breakouts and focus on robust trends.
flowchart TD
A[Macro Data: CPI, VIX, Rates] --> B[Market Regime]
B --> C{Trending?}
C -->|Yes| D[Use DMI for Signal Confirmation]
C -->|No| E[Reduce Risk, Avoid Trend Signals]
Example:
- If CPI is rising and VIX is elevated, but DMI/ADX is low, avoid trend trades.
- If CPI is stable, VIX is low, and ADX is rising, trend-following strategies using DMI are favored.
For more on macro integration, see Investopedia: Using Technicals with Macro.
Advantages and Limitations
Advantages:
- Measures both trend direction and strength
- Helps avoid whipsaws in sideways markets
- Works across asset classes and periods
Limitations:
- Lagging indicator (uses smoothed data)
- Can generate false signals in choppy markets
- The window needs tuning for different assets
References and Further Reading
- Investopedia: Directional Movement Index (DMI)
- StockCharts: DMI/ADX
- Binance Academy: ADX and DMI
- Wilder, J. Welles: New Concepts in Technical Trading Systems
Data Alignment in Systemic
DMI needs three aligned price series (High, Low, Close) from the same asset and period.
Input Requirements
| Input | Type | Alignment Behavior |
|---|---|---|
| Price High | Series | Must match length of Low and Close |
| Price Low | Series | Must match length of High and Close |
| Price Close | Series | Must match length of High and Low |
| Window | Constant | Number of bars in the window (no alignment needed) |
Automatic Alignment
If your price inputs have different periods:
- All inputs are placed on the bars of the fastest series
- A slower series repeats its last value until its next one
Critical: All three price series should come from the same asset and period. Mixing price data from different sources gives DMI readings with no meaning.
Missing Data
DMI needs both High and Low on every bar it uses. Price Close is used for True Range when it is
available, but it is not required: if the previous Close is missing, True Range is that bar's
High − Low range. The Window counts bars that have data, not calendar time. Across a
market-closed gap (holiday, weekend, no data) the smoothing continues from the last bar before
the gap to the first bar after it. The first window bars with data have no +DI/-DI/DX value.
This shows as a gap, not as a zero. In a flat window (High and Low both constant) +DI and -DI
are 0.0, and DX, which would be 0/0, is empty. The Window cannot be larger than the number of
bars in the run.
Indicator Assessment
%%{init: {"themeVariables": {"cScale0": "#4F46E5", "cScale1": "#059669"}}}%%
quadrantChart
title DMI Indicator Assessment
x-axis Low --> High
y-axis Low --> High
quadrant-1 High Popularity & Reliability
quadrant-2 High Reliability & Low Popularity
quadrant-3 Low Reliability & Popularity
quadrant-4 High Popularity & Low Reliability
"Traditional Markets": [0.85, 0.80]
"Cryptocurrency": [0.70, 0.65]
| Dimension | Stocks/Macro | Crypto | Explanation |
|---|---|---|---|
| Popularity | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | DMI/ADX is one of the most widely used trend indicators in technical analysis, created by J. Welles Wilder who also created RSI. Standard in most charting platforms. |
| Reliability | ⭐⭐⭐⭐ | ⭐⭐⭐ | Highly reliable for trend confirmation in trending markets. However, it's a lagging indicator and can generate false signals in choppy, ranging markets. |
| Complexity | ⭐⭐⭐ | ⭐⭐⭐ | Multi-step calculation involving True Range, directional movements, and smoothing. Interpretation requires understanding of +DI/-DI crossovers and ADX thresholds. |
| Versatility | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | Works across all periods and asset classes. Best for trend-following strategies; less effective in ranging markets. The three outputs (+DI, -DI, DMI) provide both direction and strength. |
| Recent Interest | ⭐⭐⭐ | ⭐⭐⭐ | Steady interest as a foundational indicator. Often combined with other Wilder indicators (RSI, ATR) in systematic trading. |
Glossary
- +DI / -DI: Positive/Negative Directional Indicator
- ADX: Average Directional Index
- True Range (TR): Largest of current high-low, high-previous close, low-previous close
- Smoothing: Averaging technique to reduce noise
- Crossover: When one indicator line crosses another, often used as a signal
- Volatility Regime: Market state defined by high or low volatility (see VIX)
- Macro Indicator: Economic data such as CPI, interest rates, or employment
This documentation is for educational purposes and should not be considered investment advice. Always consult multiple sources and consider your risk tolerance before trading.