OPEN-SOURCE SCRIPT
Smart-Limited Bar Support & Resistance + Trend Lines

# Smart-Limited Bar Support & Resistance + Trend Lines
## Overview
Smart-Limited Bar S/R + Trend lines is a market structure indicator designed to automatically identify key support and resistance levels while drawing dynamic trend lines based on price action structure.
Unlike traditional indicators that rely solely on moving averages or lagging calculations, this tool focuses on actual market structure by tracking swing highs, swing lows, higher lows, and lower highs.
The indicator is designed to help traders quickly visualize:
- Current support and resistance levels
- Trend line-based support
- Trend line-based resistance
- Structural swing points
- Potential breakout areas
---
## Features
### Dynamic Support and Resistance
The indicator continuously monitors a user-defined look back period and identifies:
- Highest High (Resistance)
- Lowest Low (Support)
By default, the script uses the last 20 bars.
When a new high or low is established within the look back window, the support or resistance level is automatically updated.
When price breaks a support or resistance level, the horizontal line stops extending, allowing traders to clearly see where the level was invalidated.
---
### Structural Swing Detection
The indicator uses pivot-based market structure analysis to identify significant turning points.
A swing high is confirmed when price forms a local peak.
A swing low is confirmed when price forms a local bottom.
Users can adjust the Pivot Strength setting to control the sensitivity of swing detection.
Higher values:
- Fewer swings
- Stronger structure
- Cleaner trend lines
Lower values:
- More swings
- Faster reaction
- Increased sensitivity
---
### Resistance Trend Lines (Lower High Structure)
The indicator automatically identifies Lower High formations.
When a new confirmed swing high is lower than the previous swing high, a resistance trend line is drawn.
This helps traders identify:
- Downtrends
- Descending resistance
- Potential breakout zones
The trendline updates automatically as new lower highs form.
---
### Support Trend lines (Higher Low Structure)
The indicator automatically identifies Higher Low formations.
When a new confirmed swing low is higher than the previous swing low, a support trendline is drawn.
This helps traders identify:
- Uptrends
- Rising support
- Potential continuation zones
The trend line updates automatically as new higher lows form.
---
### Historical Validation
Before displaying a trend line, the indicator evaluates whether the line has already been violated by price action during the swing confirmation period.
This prevents the display of structurally invalid trend lines and improves chart clarity.
---
### Swing Point Visualization
Optional swing markers can be displayed on the chart.
Red markers:
- Confirmed Swing Highs
Green markers:
- Confirmed Swing Lows
These markers help traders visually inspect market structure and understand how trend lines are generated.
---
## Inputs
### Pivot Strength
Controls swing detection sensitivity.
Default: 10
Higher values create stronger, less frequent swing points.
---
### Support/Resistance Look back
Number of bars used to calculate support and resistance.
Default: 20
---
### Minimum Bars Between Swings
Filters nearby pivots to reduce noise.
Default: 10
---
### Show Swing Points
Displays or hides swing markers.
Default: Enabled
---
## Best Use Cases
This indicator is particularly useful for:
- Price Action Trading
- Swing Trading
- Trend Following
- Market Structure Analysis
- Breakout Trading
- Support and Resistance Trading
It can be applied to:
- Stocks
- Indexes
- Futures
- Forex
- Cryptocurrency
and works across all timeframes.
---
## Trading Notes
This indicator is intended to assist with market structure analysis and should not be considered a standalone trading system.
For best results, combine it with:
- Volume analysis
- Risk management
- Trend confirmation
- Multi-timeframe analysis
Always use proper position sizing and stop-loss management when trading live markets.
## Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial, investment, or trading advice.
The indicator is designed to assist with market structure analysis by identifying support, resistance, swing points, and trendlines. No indicator can guarantee future market performance or profitable trading results.
Trading and investing involve substantial risk, including the potential loss of capital. Users should perform their own research, apply proper risk management, and consult a qualified financial professional before making investment decisions.
Use this indicator at your own risk.
## Overview
Smart-Limited Bar S/R + Trend lines is a market structure indicator designed to automatically identify key support and resistance levels while drawing dynamic trend lines based on price action structure.
Unlike traditional indicators that rely solely on moving averages or lagging calculations, this tool focuses on actual market structure by tracking swing highs, swing lows, higher lows, and lower highs.
The indicator is designed to help traders quickly visualize:
- Current support and resistance levels
- Trend line-based support
- Trend line-based resistance
- Structural swing points
- Potential breakout areas
---
## Features
### Dynamic Support and Resistance
The indicator continuously monitors a user-defined look back period and identifies:
- Highest High (Resistance)
- Lowest Low (Support)
By default, the script uses the last 20 bars.
When a new high or low is established within the look back window, the support or resistance level is automatically updated.
When price breaks a support or resistance level, the horizontal line stops extending, allowing traders to clearly see where the level was invalidated.
---
### Structural Swing Detection
The indicator uses pivot-based market structure analysis to identify significant turning points.
A swing high is confirmed when price forms a local peak.
A swing low is confirmed when price forms a local bottom.
Users can adjust the Pivot Strength setting to control the sensitivity of swing detection.
Higher values:
- Fewer swings
- Stronger structure
- Cleaner trend lines
Lower values:
- More swings
- Faster reaction
- Increased sensitivity
---
### Resistance Trend Lines (Lower High Structure)
The indicator automatically identifies Lower High formations.
When a new confirmed swing high is lower than the previous swing high, a resistance trend line is drawn.
This helps traders identify:
- Downtrends
- Descending resistance
- Potential breakout zones
The trendline updates automatically as new lower highs form.
---
### Support Trend lines (Higher Low Structure)
The indicator automatically identifies Higher Low formations.
When a new confirmed swing low is higher than the previous swing low, a support trendline is drawn.
This helps traders identify:
- Uptrends
- Rising support
- Potential continuation zones
The trend line updates automatically as new higher lows form.
---
### Historical Validation
Before displaying a trend line, the indicator evaluates whether the line has already been violated by price action during the swing confirmation period.
This prevents the display of structurally invalid trend lines and improves chart clarity.
---
### Swing Point Visualization
Optional swing markers can be displayed on the chart.
Red markers:
- Confirmed Swing Highs
Green markers:
- Confirmed Swing Lows
These markers help traders visually inspect market structure and understand how trend lines are generated.
---
## Inputs
### Pivot Strength
Controls swing detection sensitivity.
Default: 10
Higher values create stronger, less frequent swing points.
---
### Support/Resistance Look back
Number of bars used to calculate support and resistance.
Default: 20
---
### Minimum Bars Between Swings
Filters nearby pivots to reduce noise.
Default: 10
---
### Show Swing Points
Displays or hides swing markers.
Default: Enabled
---
## Best Use Cases
This indicator is particularly useful for:
- Price Action Trading
- Swing Trading
- Trend Following
- Market Structure Analysis
- Breakout Trading
- Support and Resistance Trading
It can be applied to:
- Stocks
- Indexes
- Futures
- Forex
- Cryptocurrency
and works across all timeframes.
---
## Trading Notes
This indicator is intended to assist with market structure analysis and should not be considered a standalone trading system.
For best results, combine it with:
- Volume analysis
- Risk management
- Trend confirmation
- Multi-timeframe analysis
Always use proper position sizing and stop-loss management when trading live markets.
## Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial, investment, or trading advice.
The indicator is designed to assist with market structure analysis by identifying support, resistance, swing points, and trendlines. No indicator can guarantee future market performance or profitable trading results.
Trading and investing involve substantial risk, including the potential loss of capital. Users should perform their own research, apply proper risk management, and consult a qualified financial professional before making investment decisions.
Use this indicator at your own risk.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.