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.
Script open-source

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?