OPEN-SOURCE SCRIPT

Directional Index Macro Indicator

What is This For?
The default settings for this indicator are for BTCUSDT and intended to be used on the 3D timeframe to identify market trends. This indicator does a great job identifying whether the market is bullish, bearish, or consolidating. This can also work well on lower time frames to help identify when a trend is strong or when it's reversing.

Directional Index Rate of Change
Core to this indicator is the rate at which DI+ and DI- are moving away or towards each other. This is called The Rate of Change (ROC). "The ROC length dictates how many bars back you want to compare to the current bar to see how much it has changed. It is calculated like this:

(source - source[length]/source[length]) * 100"

The rate of change is smoothed using an EMA. A shorter EMA length will cause the ROC to flip back and forth between positive and negative while a larger EMA length will cause the ROC to change less often. Since the rate of change is used to indicate periods of 'consolidation', you want to find a setting that doesn't flip back and forth too often. Between the DI+ and DI- is a blue centerline. Offset from this centerline is a channel that is used to filter out false crosses of the DI+ and DI-. Sometimes, the DI+ and DI- lines will come together in this channel and cross momentarily before resuming the direction prior to the cross. When this happens, you don't want to flip your bias too soon. The wider the channel, the later the indicator will signal a DI reversal. A narrower channel will call it sooner but risks being more choppy and indicating a false cross.

Indicator Status Line
This indicator has 4 values in the status line (in order):
  • DI+
  • DI-
  • Distance between DI+ and DI-
  • DI Rate of Change (how quickly are DI+ and DI- moving away or towards center)


Indicator Plots
This indicator plots DI+ (green), DI- (red), and a center channel between DI- and DI+. Across the top of the indicator, red and green triangles indicate the market trend while the background changes to show whether the price is in an impulse wave or consolidating. This makes up 4 possible scenarios:
  • Bullish impulse wave (green triangle up + green background)
  • Bullish consolidation (green triangle up + yellow background)
  • Bearish impulse wave (red triangle down + red background)
  • Bearish consolidation (red triangle down + yellow background)


Summary
Combined with support and resistance levels, volume, and your other favorite indicators, this can be a useful tool for validating that your entries are not going against the trend.

Disclaimer
This is not financial advice. Do not take trades only based on the DI+ and DI- crossing. Always use multiple indicators to validate your entries and never take a trade when you aren’t emotionally grounded. Have a plan. Stick to the plan.

The screenshot for this strategy is of a manual historical review of BTC on the 3 day chart. The indicator was built to try and mimic the chart above. You’ll see that it nails it sometimes, is a little late sometimes, and chops around between consolidation and impulse waves when it should stay in consolidation. Share your settings if you are able to improve the choppiness without sacrificing catching the reversals early.
Average Directional Index (ADX)BTCDIdirectionindexmacro

Script open-source

Dans le plus pur esprit TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par nos Règles. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Vous voulez utiliser ce script sur un graphique ?


Aussi sur:

Clause de non-responsabilité