jordanfray

Macro Directional Index

jordanfray Updated   
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/source) * 100
This indicator has 4 values in the status line:

  • DI+
  • DI-
  • Distance between DI+ and DI-
  • DI Rate of Change

DI Rate of Change
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.

Directional Index Middle Channel
Between the DI+ and DI- is a black 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."
Release Notes:
Updating Screenshot.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?