erdas0

ADX and SADX, SDI

The indicator aims to analyze and visualize the Average Directional Index (ADX) and its smoothed versions, along with directional indicators (DI) to help traders identify trend strength and potential buy/sell signals.

Indicator Settings:
The indicator is named "ADX and SADX, SDI" and is set to display prices with a precision of 2 decimal places.
Users can customize the ADX smoothing length, DI length, ADX smoothing period, and DI smoothing period through input variables.

Directional Movement (DM) Calculation:
The function dirmov calculates the positive and negative directional movements (DM) and the smoothed values of the positive directional index (DI+) and negative directional index (DI-).
This is done using the average true range (ATR) to normalize the DM values.

Average Directional Index (ADX) Calculation:
The function adx calculates the ADX, which measures the strength of a trend.
It uses the DI+ and DI- values to compute the ADX value.

Smoothed ADX and DI Calculation:
The ADX values are further smoothed using a simple moving average (SMA).
The DI difference is also smoothed and used to determine the trend direction.

Buy and Sell Signals:
A buy signal is generated when the DI+ crosses above DI- and the smoothed DI difference is increasing.
A sell signal is generated when the DI- crosses above DI+ and the smoothed DI difference is decreasing.

Plotting:
The ADX, smoothed ADX, smoothed DI difference (SPM), DI+, and DI- values are plotted on the chart.
Horizontal lines are drawn to indicate threshold levels (e.g., level 22).
Background and bar colors change based on buy (lime) and sell (maroon) signals to visually indicate these conditions.

Purpose of the Code:
This Pine Script code is used to create a custom indicator on TradingView that helps traders identify the strength and direction of a trend. The Average Directional Index (ADX) is used to measure trend strength, while the Directional Indicators (DI+ and DI-) are used to determine the direction of the trend. The smoothed versions of these indicators (SADX and SDI) provide additional confirmation and smoothing to reduce noise and false signals. Traders can use the buy and sell signals generated by this indicator to make informed trading decisions based on the trend strength and direction.

Important Note:
This script is provided for educational purposes and does not constitute financial advice. Traders and investors should conduct their research and analysis before making any trading decisions.
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?