OPEN-SOURCE SCRIPT
Directional Strength and Momentum Index

█ OVERVIEW
“Directional Strength and Momentum Index” (DSMI) is a technical analysis indicator inspired by DMI, but due to different source data, it produces distinct results. DSMI combines direction measurement, trend strength, and overheat levels into a single index, enhanced with gradient fills, extreme zones, entry signals, candle coloring, and a summary table.
█ CONCEPT
The classic DMI, despite its relatively simple logic, can seem somewhat chaotic due to separate +DI and -DI lines and the need for manual interpretation of their relationships. The DSMI indicator was created to increase clarity and speed up results, consolidating key information into a single index from 0 to 100 that simultaneously:
- Indicates trend direction (bullish/bearish)
- Measures movement strength
- Identifies overheat levels
- Generates ready entry signals
DMI (ADX + +DI / -DI) measures trend direction and strength, but does so based solely on comparing price movements between candles. ADX shows whether the trend is orderly and growing (e.g., above 20–30), but does not assess how dynamic the movement is.
DSMI, on the other hand, takes into account candle size and actual market aggression, thus showing directional momentum — whether the trend has real “fuel” to sustain or accelerate, not just whether it is orderly.
The main calculation difference involves replacing True Range with candle size (high-low) and using directional EMA instead of Wilder smoothing. This allows DSMI to react faster to momentum changes, eliminating delays typical of classic DMI based on TR.
This gives the trader an immediate picture of the market situation without analyzing multiple lines.
█ FEATURES
DSMI Main Line:
- EMA(Directional Index) based on +DS and -DS
- Scale 0–100, smooth color gradient depending on strength
+DS / -DS:
- Positive and Negative Directional Strength
- Gradient fill between lines — more intense with stronger trend
Extreme Zones:
- Default 20 and 80
- Gradient fill outside zones
Trend Strength Levels:
- Weak (<10) → neutral
- Moderate (up to 35)
- Strong (up to 45)
- Overheated (up to 55)
- Extreme (>55)
All levels editable
Entry Signals:
- Activated on crossing entry level (default 20)
Or on direction change when DSMI already ≥ entry level
- Highlighted background (green/red)
Candle Coloring:
- According to current trend
Trend Strength Table:
- Top-right corner
- Shows current strength (WEAK/STRONG etc.) + DSMI value
Alerts:
- DSMI Bullish Entry
- DSMI Bearish Entry
█ HOW TO USE
Add to Chart: Paste code in Pine Editor or find in indicator library.
Settings:
DSMI Parameters:
- DSMI Period → default 20
- Show DSMI Line → on/off
Extreme Zones:
- Lower Level → default 20
- Upper Level → default 80
Trend Strength Levels:
- Weak, Moderate, Strong, Overheated → adjust to strategy
Trend Colors:
- BULLISH → default green
- BEARISH → default red
- NEUTRAL → gray
Entry Signals:
- Show Highlight → on/off
- DSMI Entry Level → default 20
Signal Interpretation:
- DSMI Line: Main strength indicator.
- Gradient between +DS and -DS: Visualizes side dominance.
- Crossing 18 with direction confirmation → entry signal.
- Extreme Zones: Potential reversal or continuation points after correction.
- Table: Quick overview of current trend condition.
█ APPLICATIONS
The indicator works well in:
- Trend-following: Enter on signal, exit on direction change or overheat. When a new trend appears, consider entering a position, preferably with a rising trend strength indicator.
- Scalping/daytrading: Shorter period (7–10), lower entry level.
- Swing/position: Longer period (20–30), higher entry level, extreme zones as filters.
- Noise filtering: Ignores consolidation below “Weak” – increasing value e.g. to 15 highlights consolidation zones, but no signals appear there.
Style Adjustment:
- Aggressive strategies → shorten period and entry level
- Conservative → extend period, raise entry level (25–30), watch “Overheated”
“Weak” level (<10 default) → neutral; increasing it e.g. to 15 gives fewer but higher-quality signals. The Weak zone value controls the level below which no signals appear, and the gradient turns gray (often aligned with consolidation zones).

Combine with:
- Support/resistance levels
- Fair Value Gaps (FVG)
- Volume (Volume Profile, VWAP)
- Other oscillators (RSI, Stochastic)
█ NOTES
- Works on all markets and timeframes.
- Adjust period and levels to instrument volatility.
- Higher entry level → fewer signals, higher quality.
- Neutral color below “Weak” – avoids trading in consolidation.
- Gradient and table enable quick assessment without line analysis.
“Directional Strength and Momentum Index” (DSMI) is a technical analysis indicator inspired by DMI, but due to different source data, it produces distinct results. DSMI combines direction measurement, trend strength, and overheat levels into a single index, enhanced with gradient fills, extreme zones, entry signals, candle coloring, and a summary table.
█ CONCEPT
The classic DMI, despite its relatively simple logic, can seem somewhat chaotic due to separate +DI and -DI lines and the need for manual interpretation of their relationships. The DSMI indicator was created to increase clarity and speed up results, consolidating key information into a single index from 0 to 100 that simultaneously:
- Indicates trend direction (bullish/bearish)
- Measures movement strength
- Identifies overheat levels
- Generates ready entry signals
DMI (ADX + +DI / -DI) measures trend direction and strength, but does so based solely on comparing price movements between candles. ADX shows whether the trend is orderly and growing (e.g., above 20–30), but does not assess how dynamic the movement is.
DSMI, on the other hand, takes into account candle size and actual market aggression, thus showing directional momentum — whether the trend has real “fuel” to sustain or accelerate, not just whether it is orderly.
The main calculation difference involves replacing True Range with candle size (high-low) and using directional EMA instead of Wilder smoothing. This allows DSMI to react faster to momentum changes, eliminating delays typical of classic DMI based on TR.
This gives the trader an immediate picture of the market situation without analyzing multiple lines.
█ FEATURES
DSMI Main Line:
- EMA(Directional Index) based on +DS and -DS
- Scale 0–100, smooth color gradient depending on strength
+DS / -DS:
- Positive and Negative Directional Strength
- Gradient fill between lines — more intense with stronger trend
Extreme Zones:
- Default 20 and 80
- Gradient fill outside zones
Trend Strength Levels:
- Weak (<10) → neutral
- Moderate (up to 35)
- Strong (up to 45)
- Overheated (up to 55)
- Extreme (>55)
All levels editable
Entry Signals:
- Activated on crossing entry level (default 20)
Or on direction change when DSMI already ≥ entry level
- Highlighted background (green/red)
Candle Coloring:
- According to current trend
Trend Strength Table:
- Top-right corner
- Shows current strength (WEAK/STRONG etc.) + DSMI value
Alerts:
- DSMI Bullish Entry
- DSMI Bearish Entry
█ HOW TO USE
Add to Chart: Paste code in Pine Editor or find in indicator library.
Settings:
DSMI Parameters:
- DSMI Period → default 20
- Show DSMI Line → on/off
Extreme Zones:
- Lower Level → default 20
- Upper Level → default 80
Trend Strength Levels:
- Weak, Moderate, Strong, Overheated → adjust to strategy
Trend Colors:
- BULLISH → default green
- BEARISH → default red
- NEUTRAL → gray
Entry Signals:
- Show Highlight → on/off
- DSMI Entry Level → default 20
Signal Interpretation:
- DSMI Line: Main strength indicator.
- Gradient between +DS and -DS: Visualizes side dominance.
- Crossing 18 with direction confirmation → entry signal.
- Extreme Zones: Potential reversal or continuation points after correction.
- Table: Quick overview of current trend condition.
█ APPLICATIONS
The indicator works well in:
- Trend-following: Enter on signal, exit on direction change or overheat. When a new trend appears, consider entering a position, preferably with a rising trend strength indicator.
- Scalping/daytrading: Shorter period (7–10), lower entry level.
- Swing/position: Longer period (20–30), higher entry level, extreme zones as filters.
- Noise filtering: Ignores consolidation below “Weak” – increasing value e.g. to 15 highlights consolidation zones, but no signals appear there.
Style Adjustment:
- Aggressive strategies → shorten period and entry level
- Conservative → extend period, raise entry level (25–30), watch “Overheated”
“Weak” level (<10 default) → neutral; increasing it e.g. to 15 gives fewer but higher-quality signals. The Weak zone value controls the level below which no signals appear, and the gradient turns gray (often aligned with consolidation zones).
Combine with:
- Support/resistance levels
- Fair Value Gaps (FVG)
- Volume (Volume Profile, VWAP)
- Other oscillators (RSI, Stochastic)
█ NOTES
- Works on all markets and timeframes.
- Adjust period and levels to instrument volatility.
- Higher entry level → fewer signals, higher quality.
- Neutral color below “Weak” – avoids trading in consolidation.
- Gradient and table enable quick assessment without line analysis.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.