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 อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?