OPEN-SOURCE SCRIPT
DMI DI Gap by Bybllo

DMI DI Gap by Bybllo
This indicator plots the gap (difference) between the DI+ and DI- lines of the Directional Movement Index (DMI). Instead of visually comparing two separate DI+ / DI- lines to spot a crossover, the difference (DI+ minus DI-) is calculated directly and plotted as a single line around a zero baseline.
A cross above the zero line signals a shift toward bullish momentum, while a cross below the zero line signals a shift toward bearish momentum — each crossing is automatically marked with a buy or sell arrow, so there is no need to eyeball where the two DI lines intersect.
Key Features
A single "DI Gap" line (DI+ minus DI-) replaces the need to watch two overlapping DI+ / DI- lines and spot their crossovers by eye.
Zero-line crossover / crossunder is detected automatically and marked with buy (upward) and sell (downward) triangle arrows, offset a configurable distance from the zero line.
An optional ADX line, rescaled from its native 0–100 range to a custom min/max range, can be overlaid to gauge trend strength alongside the directional gap.
A filled cloud area between the gap line and the zero line is colored according to whether the current gap is positive or negative.
+25 / -25 dotted reference lines help gauge how strong the current directional imbalance is.
Real-price calculation via request.security() ensures values stay consistent regardless of chart type (Heikin Ashi, Renko, etc.).
How to Use
When the DI Gap line crosses above zero, a buy arrow appears below the zero line, indicating directional momentum has turned bullish (DI+ has overtaken DI-).
When the DI Gap line crosses below zero, a sell arrow appears above the zero line, indicating directional momentum has turned bearish (DI- has overtaken DI+).
Use the optional rescaled ADX line to check whether the broader trend has enough strength to support the signal before acting on it.
The +25 / -25 dotted lines can be used as a rough guide for how pronounced the current directional imbalance is.
Notes
The rescaled ADX line is for visual reference only; it does not represent the standard 0–100 ADX scale unless the scale inputs are set to 0 and 100.
Works consistently across chart types since real market price data is always pulled via request.security(), regardless of the chart type currently displayed.
This indicator plots the gap (difference) between the DI+ and DI- lines of the Directional Movement Index (DMI). Instead of visually comparing two separate DI+ / DI- lines to spot a crossover, the difference (DI+ minus DI-) is calculated directly and plotted as a single line around a zero baseline.
A cross above the zero line signals a shift toward bullish momentum, while a cross below the zero line signals a shift toward bearish momentum — each crossing is automatically marked with a buy or sell arrow, so there is no need to eyeball where the two DI lines intersect.
Key Features
A single "DI Gap" line (DI+ minus DI-) replaces the need to watch two overlapping DI+ / DI- lines and spot their crossovers by eye.
Zero-line crossover / crossunder is detected automatically and marked with buy (upward) and sell (downward) triangle arrows, offset a configurable distance from the zero line.
An optional ADX line, rescaled from its native 0–100 range to a custom min/max range, can be overlaid to gauge trend strength alongside the directional gap.
A filled cloud area between the gap line and the zero line is colored according to whether the current gap is positive or negative.
+25 / -25 dotted reference lines help gauge how strong the current directional imbalance is.
Real-price calculation via request.security() ensures values stay consistent regardless of chart type (Heikin Ashi, Renko, etc.).
How to Use
When the DI Gap line crosses above zero, a buy arrow appears below the zero line, indicating directional momentum has turned bullish (DI+ has overtaken DI-).
When the DI Gap line crosses below zero, a sell arrow appears above the zero line, indicating directional momentum has turned bearish (DI- has overtaken DI+).
Use the optional rescaled ADX line to check whether the broader trend has enough strength to support the signal before acting on it.
The +25 / -25 dotted lines can be used as a rough guide for how pronounced the current directional imbalance is.
Notes
The rescaled ADX line is for visual reference only; it does not represent the standard 0–100 ADX scale unless the scale inputs are set to 0 and 100.
Works consistently across chart types since real market price data is always pulled via request.security(), regardless of the chart type currently displayed.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。