OPEN-SOURCE SCRIPT
Telah dikemas kini

Directional Strength Index

5 843
This indicator is designed to detect the dominant market direction and quantify its strength by aggregating signals across six key timeframes: 1H, 4H, 1D, 3D, 1W, and 1M.

At its core, it uses a SMEMA 'the Simple Moving Average of an EMA' as the main trend reference. This hybrid smoothing method was chosen for its balance: the EMA ensures responsiveness to recent price moves, while the SMA dampens short-term volatility. This makes the SMEMA more stable than a raw EMA and more reactive than a simple SMA, especially in noisy or volatile environments.

For each timeframe, a score between -10 and +10 is calculated. This score reflects:
- the distance of the price from the SMEMA, using ATR as a dynamic threshold
- the number of price deviations above or below the SMEMA
- the slope of the SMEMA, which adjusts the score based on momentum

These six timeframe scores are then combined into a single Global Score, using weighted averages. Three weighting profiles are available depending on your trading horizon:
- Long Term: emphasizes weekly and monthly data
- Swing Trading: gives balanced importance to all timeframes
- Short Term: prioritizes 1H and 4H action

This multi-timeframe aggregation makes the indicator adaptable to different styles while maintaining a consistent logic.

The result is displayed in a table on the chart, showing:
- the trend direction per timeframe (up, down or neutral)
- the strength score per timeframe
- the overall trend direction and strength based on the selected profile

Optional deviation bands based on ATR multiples are also plotted to provide visual context for overextensions relative to the SMEMA.

This indicator is non-repainting and built for objective, trend-based decision making.
Nota Keluaran
Minor Update: The summary row now shows "Global LT", "Global SW", or "Global ST" to match your selected trend focus (Long Term, Swing, or Short Term). Clearer and takes less space.
Nota Keluaran
Minor Update: I changed the label in the table to "Global Trend".
Nota Keluaran
Minor update: I had forgotten to rename the input to "Global Trend Weighting" for consistency with the table label. Fixed.
Nota Keluaran
Minor update: added Intraday weighting mode to the Global Trend score (based on 1m to 1H timeframes). Also added a tooltip to the weighting input with detailed allocations for all four modes (Long Term, Swing Trading, Short Term, Intraday).

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.