OPEN-SOURCE SCRIPT

Directional Movement Indicator (DMI and ADX) - Tartigradia

업데이트됨
Direction Movement Indicator (DMI) is a trend indicator invented by Welles Wilder, who also authored RSI.

DMI+ and DMI- respectively indicate pressure towards bullish or bearish trends.

ADX is the average directional movement, which indicates whether the market is currently trending (high values above 25) or ranging (below 20) or undecided (between 20 and 25).

DMX is the non smoothed ADX, which allows to detect transitions from trending to ranging markets and inversely with zero lag, but at the expense of having much more noise.

This is an extended indicator, from the original one by BeikabuOyaji, please show them some love if you appreciate this indicator:
ADX and DI


Usage: To use this indicator for entry: when DMI+ crosses over DMI-, there is a bullish sentiment, however ADX also needs to be above 25 to be significant, otherwise the move is not necessarily sustainable.

Inversely, when DMI+ crosses under DMI- and ADX is above 25, then the sentiment is significantly bearish, but if ADX is below 20, the signal should be disregarded.

This indicator automatically highlights the background in green when ADX is above 25, and in red when ADX is below 20, to ease interpretation.

Also, arrows can be activated in the Style menu to automatically show when the two conditions described above are met, or these can be used in a strategy.
릴리즈 노트
Set weekly timeframe as default, as it is much more useful on this timeframe than in any other.
릴리즈 노트
Update:
* Add other MA types, and set default to ZLMA, to make ADX react faster to trend changes.
* Add "Trend bar", which neatly summarizes all the infos given by this indicator in a colored bar.

Updated usage instructions:

To use this indicator for entry: when DMI+ crosses over DMI-, there is a bullish sentiment, however ADX also needs to be above 25 to be significant, otherwise the market is not trending.
When ADX is below 20, the market is ranging (no trend), and when ADX is between 20 and 25, the market is undecided (we don't know if it's trending or ranging).
Inversely, when DMI+ crosses under DMI- and ADX is above 25, then the sentiment is significantly bearish, but if ADX is below 20, the signal should be disregarded, since market is ranging.

This indicator automatically highlights the background in blue when ADX is above 25 to indicate that there is a trend, regardless of its direction, and in orange when ADX is below 20, indicating that the market is ranging.

There is a "Trend bar" at the bottom that allows for easy interpretation:
  • it is colored in green when the market is bullishly trending (DMI+ over DMI- and ADX > 25)
  • in red when market is bearishly trending (DMI+ under DMI- and ADX > 25)
  • in orange when market is ranging (ADX < 20)
  • in gray when market is undecided (20 <= ADX < 25)


To make trend changes signals appear faster, the default SMA calculations embedded inside the ADX and DMI calculations are replaceable by other types of moving averages. By default, a Zero-Lag Moving Average (ZLMA) is selected, as it provides a smooth yet very reactive signal.

To get the most reactive signal, smoothing can be disabled by highlighting the background and trend bar using DMX, which is the non-smoothed ADX, and is hence much more reactive but also much more noisy (disabled by default).

Finally, arrows can be activated in the Style menu to automatically show when the two conditions described above are met, or these can be used in a strategy.

By default, this indicator is set to always calculate on the weekly timeframe, as this is when the signals appear to be the most reliable. The timeframe can however be changed in the parameters, and can be set to "Chart" to adapt to currently user selected timeframe in TradingView.
릴리즈 노트
Update:
* Refactor code to make the moving average of DMI+ and DMI- configurable. But in practice, it's better to use the default "approximate_sma" for DMI+ and DMI-. However, for ADX, using another MA such as ZLMA greatly improves reactivity.
* Refactor code to standardize variables naming to conventional names (eg, DI -> DMI).
릴리즈 노트
Update:
* Add tooltips for DMI and ADX moving average type selectors in INPUTS parameters to describe the values to set to get the original indicators as defined by Welles Wilder.
릴리즈 노트
Update:
* fix plotshape so that long/short signals now work.
* change color palette to be visible to color blind individuals, and also to avoid misinterpretations (e.g., misunderstanding the ADX trend coloring the background in aqua does not mean that the market is bullish, just that it is trending in either direction).

Updated instructions:

This indicator automatically highlights the background in purple when ADX is above 25 to indicate that there is a trend, regardless of its direction, and in dark blue when ADX is below 20, indicating that the market is ranging. When the market is undecided, the background is not highlighted.

There is a "Trend bar" at the bottom that allows for easy interpretation:
* it is colored in green when the market is bullishly trending (DMI+ over DMI- and ADX > 25).
* in red when market is bearishly trending (DMI+ under DMI- and ADX > 25).
* in dark blue when market is ranging (ADX < 20).
* in gray when market is undecided (20 <= ADX < 25).
릴리즈 노트
Update:
* add signal when trend disappears
릴리즈 노트
Update:
* Remove -1 offset for bgcolor, it produced nonsensical results.
릴리즈 노트
* Cosmetic change: remove the signals values from being displayed in the indicator price line
ADXdirectionalmovementindexDMITrend Analysis

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항