Support and Resistance Lookback based
Sep 22, 2020

The Support and Resistance Lookback based indicator identifies key price levels by analyzing historical extremes over a user-defined lookback period to help traders spot potential reversal zones.
Usage
The Support and Resistance Lookback based tool is designed to highlight significant price ceilings (resistance) and floors (support) directly on the chart. Traders can use these levels to:
- Identify potential entry and exit points based on price reactions to historical highs and lows.
- Set stop-loss or take-profit targets around validated zones.
- Gauge market volatility by observing the distance and density of the formed levels.
The indicator plots circles at specific price levels whenever a new local high or low is confirmed. Resistance levels are typically colored red, while support levels are colored green. The sensitivity of these levels is controlled by the lookback and distance settings, allowing for either a broad or granular view of the market structure.
Details
The script functions by scanning a specific lookback window to find the highest and lowest price points. To ensure the levels are significant and not cluttered, it implements two primary filters:
- Confirmation Logic: It checks if the current price extreme is higher/lower than several preceding candles and if it has effectively "rolled over" or "bounced" from that peak/trough.
- Distance Filtering: The indicator calculates the average return of the asset to determine a dynamic minimum distance between levels. A new level will only be recorded if it is sufficiently far away from existing recent levels, preventing the chart from being overwhelmed by minor price fluctuations.
The rounding function ensures that levels are normalized, making them easier to read and more reflective of psychological price points.
Settings
Main Settings
- Support & Resistance Levels Source: Determines which price data is used to calculate levels (Close, High/Low, Highwick/Lowwick, or OHLC4).
- S&R Levels Loopback: The number of candles the script looks back to identify a local maximum or minimum.
- Distance Between S&R Levels: A multiplier that dictates how far a new level must be from existing levels to be plotted.
- S&R Max Levels: Limits the internal array size for level calculations.
- Sell Zone: A parameter used for internal calculation thresholds.
- Highlight Tops & Bottoms?: Toggles the visibility of specific breach highlights on the chart.
FAQ
How do I interpret the circles on the chart?
The circles represent historical price levels where the market found significant supply (red) or demand (green). When price approaches these levels again, it may experience resistance or support.
Can I change the sensitivity of the levels?
Yes, by increasing the "S&R Levels Loopback," the indicator will look for more significant, long-term levels. Decreasing it will show more frequent, short-term levels.
How can I access Support and Resistance Lookback based?
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.