AlgoAlpha
TradingView IndicatorFree to Use

Machine Learning Adaptive DMI Signals

Free TradingView Indicator by AlgoAlpha — Breakout & Levels

The Directional Movement Index (DMI) is commonly calculated using a fixed lookback length. But market conditions change over time, and a length that works well during one period may become less effective during another.

10.5kviews
1.2kboosts
2026-06-16published

What is Machine Learning Adaptive DMI Signals?

The Directional Movement Index (DMI) is commonly calculated using a fixed lookback length. But market conditions change over time, and a length that works well during one period may become less effective during another.
This script builds multiple DMI models across a user-defined range of lengths and continuously evaluates their past performance. Each DMI length acts as an independent expert. As new directional flips occur, the script measures how well each expert performed and updates its internal scoring system.
The result is an adaptive DMI that automatically shifts toward lengths that have recently produced better directional signals while reducing the influence of weaker performers.

Machine Learning Adaptive DMI Signals Features

Adaptive +DI and -DI Lines
Displays directional movement using a dynamically selected DMI length that adjusts over time.
TradingView Chart Snapshot
TradingView Snapshot
Directional Clouds
Color-filled regions between the DI lines help visualize which side currently has directional control.
TradingView Chart Snapshot
TradingView Snapshot
Bullish and Bearish Flip Signals
▲ and ▼ markers appear when the Adaptive +DI and -DI lines cross.
TradingView Chart Snapshot
TradingView Snapshot
ADX Strength Display
Strength squares at the bottom of the pane become more visible as trend strength increases and fade as strength decreases.
TradingView Chart Snapshot
TradingView Snapshot
Information Table
Displays the active adaptive length, selected scoring mode, memory count, and current bullish or bearish trend state in a customizable table.
TradingView Chart Snapshot
TradingView Snapshot

How Machine Learning Adaptive DMI Signals Works

• Expert DMI — A DMI calculation running at a specific lookback length within the tested range.
• Directional Flip — A change in trend state when +DI crosses above -DI or when -DI crosses above +DI.
• Reward Score — A performance score assigned to each completed flip based on return, move quality, pullback behavior, or win rate.
• Maximum Favorable Excursion (MFE) — The largest move in the trade's favor before the next directional flip.
• Maximum Adverse Excursion (MAE) — The largest move against the trade before the next directional flip.
• Recency Decay — A weighting system that gradually reduces the influence of older observations so recent market behavior has greater impact.
• Softmax Weighting — A probability-style weighting process that gives greater influence to higher-scoring DMI lengths when estimating the adaptive length.

How to Use Machine Learning Adaptive DMI Signals

• Watch for bullish flips when Adaptive +DI crosses above Adaptive -DI to identify potential shifts toward upward directional control.
• Watch for bearish flips when Adaptive -DI crosses above Adaptive +DI to identify potential shifts toward downward directional control.
• Use the ADX strength squares to gauge whether directional movement is strengthening or weakening.
• Increase the tested length range when evaluating a wider variety of market conditions.
• Increase Memory and Forget Old Trades values for more stable adaptation and slower length changes.
• Decrease Memory or lower the decay factor when faster adaptation to recent behavior is preferred.
• Experiment with the available scoring methods to determine whether return, trend quality, or consistency is more important for your analysis.

Add this indicator to your chart.

Machine Learning Adaptive DMI Signals is free to use on TradingView. Add it to any chart in seconds.