OPEN-SOURCE SCRIPT
Cập nhật DMI Badge by Bybllo

DMI Badge by Bybllo
This indicator plots simple Long/Short badges based purely on the Directional Movement Index (DMI): a Long badge appears on a golden cross (DI+ crossing above DI-) and a Short badge appears on a dead cross (DI- crossing above DI+), with both filtered by a minimum ADX threshold so only crosses backed by sufficient trend strength are marked. It is a lightweight, standalone way to see DMI golden-cross / dead-cross signals directly on the chart without having to watch the DI+ / DI- lines separately.
This script is also intended as a reference companion to "Buy Sell Badge with DMI by Bybllo": that indicator's optional "BSB + DMI" filter uses this exact same DMI golden-cross / dead-cross + ADX logic internally to confirm its EMA-based signals. Running this indicator alongside it lets you see the underlying DMI badges on their own, independent of the EMA signal, so you can verify or tune the DMI-side behavior (length, ADX threshold, badge spacing) before relying on the combined confirmation filter.
Key Features
Long badge on a DMI golden cross (DI+ crossing above DI-), Short badge on a DMI dead cross (DI- crossing above DI+).
ADX threshold filter: a badge is only shown when ADX is at or above your configured minimum, filtering out crosses that lack real directional strength.
Badge spacing (cooldown) input prevents duplicate badges from firing on consecutive bars after a signal.
Real-price calculation via request.security() keeps signals consistent regardless of chart type (Heikin Ashi, Renko, etc.).
alertcondition() calls for both Long and Short badges, ready to use for TradingView alerts.
How to Use
A Long badge below the bar means DI+ has just crossed above DI- with ADX at or above your threshold — a bullish directional shift with trend strength behind it.
A Short badge above the bar means DI- has just crossed above DI+ with ADX at or above your threshold — a bearish directional shift with trend strength behind it.
Raise the ADX threshold to show fewer, higher-conviction badges; lower it to see more crosses, including weaker ones.
Increase "Badge Spacing" if you want more separation between consecutive badges on choppy charts.
If you use "Buy Sell Badge with DMI by Bybllo" with its "BSB + DMI" filter enabled, keep the DMI Length, ADX Threshold, and Badge Spacing here aligned with that indicator's DMI settings so the two stay in sync.
Notes
This indicator only plots DMI-based signals; it does not include any EMA logic, stop-loss/take-profit management, or position tracking. For a combined EMA + DMI signal with risk management, see "Buy Sell Badge with DMI by Bybllo".
This indicator plots simple Long/Short badges based purely on the Directional Movement Index (DMI): a Long badge appears on a golden cross (DI+ crossing above DI-) and a Short badge appears on a dead cross (DI- crossing above DI+), with both filtered by a minimum ADX threshold so only crosses backed by sufficient trend strength are marked. It is a lightweight, standalone way to see DMI golden-cross / dead-cross signals directly on the chart without having to watch the DI+ / DI- lines separately.
This script is also intended as a reference companion to "Buy Sell Badge with DMI by Bybllo": that indicator's optional "BSB + DMI" filter uses this exact same DMI golden-cross / dead-cross + ADX logic internally to confirm its EMA-based signals. Running this indicator alongside it lets you see the underlying DMI badges on their own, independent of the EMA signal, so you can verify or tune the DMI-side behavior (length, ADX threshold, badge spacing) before relying on the combined confirmation filter.
Key Features
Long badge on a DMI golden cross (DI+ crossing above DI-), Short badge on a DMI dead cross (DI- crossing above DI+).
ADX threshold filter: a badge is only shown when ADX is at or above your configured minimum, filtering out crosses that lack real directional strength.
Badge spacing (cooldown) input prevents duplicate badges from firing on consecutive bars after a signal.
Real-price calculation via request.security() keeps signals consistent regardless of chart type (Heikin Ashi, Renko, etc.).
alertcondition() calls for both Long and Short badges, ready to use for TradingView alerts.
How to Use
A Long badge below the bar means DI+ has just crossed above DI- with ADX at or above your threshold — a bullish directional shift with trend strength behind it.
A Short badge above the bar means DI- has just crossed above DI+ with ADX at or above your threshold — a bearish directional shift with trend strength behind it.
Raise the ADX threshold to show fewer, higher-conviction badges; lower it to see more crosses, including weaker ones.
Increase "Badge Spacing" if you want more separation between consecutive badges on choppy charts.
If you use "Buy Sell Badge with DMI by Bybllo" with its "BSB + DMI" filter enabled, keep the DMI Length, ADX Threshold, and Badge Spacing here aligned with that indicator's DMI settings so the two stay in sync.
Notes
This indicator only plots DMI-based signals; it does not include any EMA logic, stop-loss/take-profit management, or position tracking. For a combined EMA + DMI signal with risk management, see "Buy Sell Badge with DMI by Bybllo".
Phát hành các Ghi chú
Minor label wording update on the ADX Threshold input ("ADX Threshold (minimum)" → "ADX Threshold (Min)"). No change to indicator logic or signal behavior.Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
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.