Support/Resistance
Jun 11, 2023

The Support/Resistance indicator identifies key horizontal levels based on pivot points and tracks price interactions such as breakouts and bounces in real-time. By dynamically projecting these levels across the chart, it provides traders with clear visual areas where price is likely to face rejection or find support.
Usage
The tool can be used to identify potential entry or exit zones by monitoring how price reacts to historical high and low pivots.
- Breakouts: Occur when the price closes above a resistance line (red) or below a support line (green). These events often signal a shift in market momentum.
- Bounces/Rejections: Occur when the price touches a level and produces an engulfing candlestick pattern in the opposite direction without breaking through. For example, a bearish engulfing at a red resistance line indicates a rejection.
- Momentum Confluence: This script is best utilized alongside momentum indicators to determine if a move toward a level has enough strength to break out or if it is likely to reverse.
Details
The script uses a pivot-based calculation method to determine the placement of support and resistance lines. It utilizes the ta.pivothigh() and ta.pivotlow() functions to find structural peaks and valleys. Once a pivot is confirmed (based on the "Sensitivity" setting), a horizontal line is drawn and updated on every bar.
The logic includes internal tracking via arrays to ensure that breakouts and bounces are only triggered once per level until a new pivot is formed. The script also includes built-in alert conditions for resistance breakouts, resistance rejections, support breakouts, and support rejections.
Settings
Main Settings
- Pivot Method: Determines whether the pivot calculation uses the "Candle Wicks" (high/low) or "Candle Body" (open/close).
- Sensitivity: Sets the number of bars required to the left and right to confirm a pivot point. Higher values result in more significant but fewer levels.
Style Settings
- Line Width: Adjusts the thickness of the support and resistance lines plotted on the chart.
FAQ
How do I use the Support/Resistance indicator?
You can use it to visualize key price levels where the market has previously reversed. Look for candle closes beyond these lines for breakouts or engulfing patterns at the lines for potential bounces.
Can I set alerts for level breaches?
Yes, the script is optimized with alert conditions that trigger when price breaks through or rejects from a confirmed support or resistance level.
How do I access this script?
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.