ADX by cobra
Apr 14, 2016

The ADX by cobra indicator provides a refined approach to trend strength and direction analysis by combining the Average Directional Index (ADX) with Positive and Negative Directional Indicators (DI+ and DI-). This tool helps traders identify high-momentum trend phases and potential exhaustion points through color-coded background signals and customizable thresholds.
Usage
The Usage section describes how the script can be used to interpret market momentum and trend direction. The indicator displays three primary lines: the DI+ (green), DI- (red), and the ADX (white/foreground color).
- Trend Identification: When the DI+ line is above the DI-, the market is considered to be in an uptrend. Conversely, when the DI- is above the DI+, a downtrend is indicated. The tool highlights these conditions with green or red background shading to signify the dominant directional bias.
- Trend Strength: The ADX line measures the intensity of the current trend regardless of direction. A common strategy involves looking for the ADX to cross above the user-defined threshold (defaulted to 20) to confirm that a trend is strengthening.
- Exhaustion Signals: The indicator includes logic to identify overextended conditions. If the DI+ or DI- exceeds a value of 60, specific background highlights (orange or teal) appear to warn the user of potential trend exhaustion or extreme volatility.
Details
The script is a refactored and visually updated version of the original concept by @binary_trader66. It calculates the True Range and Directional Movement using a smoothing technique that subtracts a portion of the previous value before adding the current period's data.
The ADX itself is calculated as a Simple Moving Average (SMA) of the Directional Index (DX), which is derived from the ratio between the difference and the sum of the DI+ and DI-. This specific implementation utilizes shorter default lengths (Length: 3) compared to traditional ADX settings, making it more responsive to short-term price fluctuations and scalp opportunities.
Settings
- Length: The lookback period used for smoothing the True Range, DI+, and DI- calculations. Smaller values increase sensitivity.
- Length1: The period used for the Simple Moving Average of the directional crosses, affecting how the background bias shading is smoothed.
- threshold: The horizontal level used to determine the minimum trend strength required for a valid trend signal.
FAQ
How do I interpret the background colors? Green backgrounds indicate a bullish bias (DI+ > DI-), while red backgrounds indicate a bearish bias (DI- > DI+). Bright orange or dark teal highlights appear when DI levels exceed 60, suggesting extreme momentum or potential overbought/oversold states.
What does the horizontal dashed line represent? The dashed line represents the trend strength threshold. When the ADX line is above this level, it suggests the market is trending; when below, it suggests the market is range-bound or in a weak trend.
How can I access this indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.