Support and Resistance Levels
Dec 5, 2020

The Support and Resistance Levels indicator identifies key market decision points by utilizing the first and second derivatives of smoothed price action to detect turning points and local extremes.
Usage
The indicator can be used to identify potential entry and exit zones based on institutional supply and demand areas. When the price falls below a support level, it may indicate a trend reversal or a failed long position, while a break above resistance suggests a potential breakout or a failed short position.
Traders can use this tool to:
- Identify local market highs and lows for stop-loss placement.
- Determine the slope and momentum of the current trend.
- Filter signals using directional movement to ensure trades align with broader market context.
The levels are drawn dynamically on the chart based on the lookback period, providing a visual representation of where price has historically stalled or reversed.
Details
The script operates on the principle that the first derivative (momentum) of a price curve defines its slope. When this slope reaches zero, the price has hit a local extreme. To refine this, the script calculates the second derivative (momentum of momentum).
The detection process follows these steps:
- Smoothing: The price is smoothed using a Double Exponential Moving Average (DEMA) to remove noise.
- First Momentum: The script calculates the momentum of the DEMA.
- Second Momentum: The script calculates the momentum of the first momentum.
- Zero-Crossing Detection: When the second momentum crosses zero, it signals that the original curve is switching between acceleration and deceleration, marking a timely turning point in the market.
Settings
- Lookback Window: Determines the period used for the DEMA smoothing and the calculation of highest highs and lowest lows. Higher values result in longer-term support/resistance levels.
- Filter DMI?: When enabled, the indicator will only show support levels if the Positive Directional Movement (PDM) is greater than the Negative Directional Movement (MDM), and vice versa for resistance.
- Show Channel?: Toggles the visibility of the step-line channel connecting the detected extremes.
FAQ
How do I interpret the lines on the chart?
Green lines represent support levels where buying pressure has historically emerged, while red lines represent resistance levels where selling pressure has historically intensified.
Does the indicator repaint?
The indicator uses historical momentum calculations and highest/lowest price points within a lookback window. While lines are drawn once the momentum criteria are met, the levels themselves are based on established price extremes within the lookback period.
How can I access this tool?
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.