OPEN-SOURCE SCRIPT

DMI DI Gap by Bybllo

230
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.

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.