cryptographic1

ADX and DI (Average Directional Index) - CORRECT FORMULA

So... the popular version of "ADX and DI" shown on tradingview by masanakamura uses some wacky and incorrect formula for DI and uses SMA instead of the Wilder's MA that ADX /DI is supposed to use, and doesn't give the correct ADX and DI values. The Tradingview "Average Directional Index" uses the correct calculation but doesn't show DI+ and DI-. So, here it is with the DI+ and DI- visible. Enjoy!
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,因此交易者可以理解和验证它。为作者加油! 您可以免费使用它,但是在发布中重复使用此代码受网站规则的约束。您可以收藏它以在图表上使用。

想在图表上使用此脚本?

评论

Thank you for the correct formula. This one works!
回复
For those unaware, TradingView provides most of the common indicators with viewable source. If you go to Pine Editor and click there is a drop down list containing each of them. Click "Directional Movement Index" for example, and you will see that indicator's source loaded in the Pine Editor window. You can then click if you wish to save a copy and/or click if you wish to load it. Once loaded, you will see it contains both ADX and DI. The "Directional Movement Index" indicator source provided by TradingView in Pine Editor's list exactly matches with the readings of the author's source displayed above, only difference being that TradingView's script is set for higher precision.

When you encounter an indicator from the public library that seems off, it is useful to check and compare from this alternate repository accessed from the Pine Editor.
回复
allanster allanster
^ Typo in 2nd sentence above, missing the word -> "If you go to Pine Editor and click there is a drop down list containing each of them."
+1 回复
allanster allanster
Apparently TradingView is removing anything I type with "bracket word bracket" so one more time with quotes instead of brackets lol...

For those unaware, TradingView provides most of the common indicators with viewable source. If you go to Pine Editor and click "New" there is a drop down list containing each of them. Click "Directional Movement Index" for example, and you will see that indicator's source loaded in the Pine Editor window. You can then click "Save" if you wish to save a copy and/or click "Add to Chart" if you wish to load it. Once loaded, you will see it contains both ADX and DI. The "Directional Movement Index" indicator source provided by TradingView in Pine Editor's "New" list exactly matches with the readings of the author's source displayed above, only difference being that TradingView's script is set for higher precision.

When you encounter an indicator from the public library that seems off, it is useful to check and compare from this alternate repository accessed from the Pine Editor.
回复
thanks man, will try an adaptation for this, good script
回复
wow, simply outstanding. thank you
回复
Cool man, thank you !
回复
thanx a lot dude!
回复
thanks a lot !
回复
thanks for the correct formula bro
回复