This Pine Script indicator calculates and displays the Average Directional Index (ADX) along with the DI+ and DI- lines to help identify the strength and direction of a trend. The script is designed for Pine Script v6 and includes customizable settings for a more tailored analysis.
Features: ADX Calculation:
The ADX measures the strength of a trend without indicating its direction. It uses a smoothing method for more reliable trend strength detection. DI+ and DI- Lines (Optional):
The DI+ (Directional Index Plus) and DI- (Directional Index Minus) help determine the direction of the trend: DI+ indicates upward movement. DI- indicates downward movement. These lines are disabled by default but can be enabled via input settings. Customizable Threshold:
A horizontal line (hline) is plotted at a user-defined threshold level (default: 20) to highlight significant ADX values that indicate a strong trend. Slope Analysis:
The slope of the ADX is analyzed to classify the trend into: Strong Trend: Slope is higher than a defined "medium" threshold. Moderate Trend: Slope falls between "weak" and "medium" thresholds. Weak Trend: Slope is positive but below the "weak" threshold. A background color changes dynamically to reflect the strength of the trend: Green (light or dark) indicates trend strength levels. Custom Colors:
ADX color is customizable (default: pink #e91e63). Background colors for trend strength can also be adjusted. Independent Plot Window:
The indicator is displayed in a separate window below the price chart, making it easier to analyze trend strength without cluttering the main price chart. Parameters: ADX Period: Defines the lookback period for calculating the ADX (default: 14). Threshold (hline): A horizontal line value to differentiate strong trends (default: 20). Slope Thresholds: Adjustable thresholds for weak, moderate, and strong trend slopes. Enable DI+ and DI-: Boolean options to display or hide the DI+ and DI- lines. Colors: Customizable colors for ADX, background gradients, and other elements. How to Use: Identify Trend Strength: Use the ADX value to determine the strength of a trend: Below 20: Weak trend. Above 20: Strong trend. Analyze Trend Direction: Enable DI+ and DI- to check whether the trend is upward (DI+ > DI-) or downward (DI- > DI+). Dynamic Slope Detection: Use the background color as a quick visual cue to assess trend strength changes. This indicator is ideal for traders who want to measure trend strength and direction dynamically while maintaining a clean and organized chart layout.