OPEN-SOURCE SCRIPT

Average Directional Index + ΔDI± (Delta)

已更新
Average Directional Index (ADX) and Difference between DI+ and DI- (ΔDI±), I call it Delta for short.

The idea explained:
ADX is a common indicator for analysing trend strength. Values over 25 usually indicate the symbol is in "trend mode", meaning there is a lot of momentum, upwards or downwards, - while values under 25 suggest it is in "range mode", the price moves sideways, lacking energy. Note that this indicator is not volume-based.
I moved the graph (red) down 25 points; this version shows positive values in "trend mode" (>25), and negative values in "range mode" (<25). The line sits at 0. The underlying code for the ADX is basically identical to the official TradingView built-in version.

Now the exciting part: DI+ and DI- are used to calculate the ADX. They are sometimes included in the ADX indicator chart, I included a version that shows them in the graphic, at the bottom. Traditionally, DI+ (green) crossing DI- (dark red) from below shows the beginning of an upward trend, and therefore a good LONG entry position. However, I noticed that this is usually not the case: this method responds very slowly to the actual price movement. At the point the indicator tells you to enter, the trend is usually already exhausted.
I found a better way to use this data; instead of waiting for both graphs to cross, meaning the difference in their respective values is 0, we look for the greatest possible difference. That is what the purple graph of my indicator shows (ΔDI±). It utilizes the zero-line we already created for the ADX. High positive values declare that the DI+ is much greater than the DI-, and vice versa. Delta is the greek letter used in mathematics for difference, so that is what I call this indicator.

How to use it:
When you look at the graph, low Delta values seem to be good entry points for LONG positions, high Delta values good exits. This is similar to how RSI and CCI work, which is why included them in the chart above (tradingview.com/script/9EX6Tyup-Commodity-Channel-Index-Relative-Strength-Index-Same-Scale/). However, this is only reliable, when the ADX is above 25, or 0 in this version, indicating the symbol is in "trend mode". This is important.

When you look at the examples in the chart, you can confirm that. The marked candles show good entry and exit points, with Delta being notably low/high (±25 seems to be a good threshold, the dashed lines sit at +30/-30), and the ADX above 0 (25). Now, you might have noticed that around mid-december the Delta actually registers the highest value for this symbol in the given time frame, indicating a strong SHORT after a steep climb. But, importantly, the ADX is not in "trend mode" as required for a clear signal, it is in "range mode": the price discovers this new level and takes a few days to get used to it. It does not fall. This shows why only the combination of both Delta and ADX gives desirable results.

I noticed that this seems to work best for 1D and 1H candles; if you find any other time frames or scenarios, let me know!

PLEASE NOTE THAT THIS IS BASED ON PERSONAL, EMPIRICAL OBSERVATIONS. PAST RESULTS DO NOT GUARANTEE SUCCESS IN THE FUTURE. DO NOT TAKE THIS AS INVESTMENT ADVICE!

Thanks to TradingView and robertkowalski for providing the basis on which the code is built. Credit goes to the appropriate developers/owners.
(tradingview.com/script/FG6aHUuF-Average-Directional-Index-with-DI-and-DI/)

Let me know if you make any other observations, or find other ways to use the data!
版本注释
Updated code to comply with new PineScript guidelines. Changed default appearance slightly. (Still customizable through "Style Menu")
ADXCentered OscillatorsdeltaDIdifferenceOscillatorsTrend Analysis

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明