OPEN-SOURCE SCRIPT
Dynamic Support and Resistance with Trend Lines

Dynamic Support and Resistance with Trend Lines (DSRTL)
1. Introduction & Methodology
The DSRTL indicator is designed to provide a multidimensional analysis of market structure. Unlike traditional tools that rely solely on price pivots, this script combines Static Volume-based Zones with Dynamic Trend Lines to evaluate the price's position relative to critical market components.
The S/R Identification Technique
Instead of standard pivot points, DSRTL utilizes Volume Analysis to highlight areas of significant trader participation:
- Strategy A:
Matrix Climax: Identifies candles within the lookback period that are near price extremes (Highs/Lows) and coincide with significant buying or selling volume.
- Strategy B:
Volume Extremes: Detects candles with the absolute highest buy/sell volumes within the selected lookback window, creating extreme volume-based S/R zones.
- Result:
This creates Support/Resistance (S/R) zones that are validated by actual market activity, not just price geometry.
Dynamic Trend Lines
To complement the static zones, the indicator employs two adaptive channel methods:
- Pivot Span: Connects recent significant pivots for a fast, reactive trend corridor.
- 5-Point Channel: Segments the lookback period into 5 parts to perform a linear regression analysis, creating a stable and statistically significant channel.
2. Volume Calculation Methodology
Accurate S/R detection requires distinguishing Buy Volume from Sell Volume. DSRTL offers two calculation modes:
- Geometry (Source File): Estimates buy/sell volume based on the Close price's position relative to the High/Low of the candle.
Note: This is an approximation that works on all plan types as it does not require intrabar data.
- Intrabar (Precise): Analyzes historical lower-timeframe data (e.g., 15S) to calculate intrabar-based volume deltas with higher precision compared to the geometric method.
Note: This offers superior accuracy. It requires access to historical intrabar data (depending on your plan limits). For the best analytical results, use this mode if available.
3. The Smart Matrix Engine (3D Analysis)
The core of DSRTL is its dashboard, powered by the "Smart Matrix Engine." This engine evaluates the current price in a multi-layer market structure context (Static Volume Zones + Dynamic Channels + Volume Metrics).:
A. S-State (Static): Where is the price relative to the Volume S/R zones?
B. D-State (Dynamic): Where is the price relative to the Trend Channels?
How to read the Matrix Map:
The dashboard displays a 5x5 grid representing 25 possible market scenarios.
- Rows (S1-S5): Represent the Static State (S1=Breakout, S3=Mid-Range, S5=Breakdown).
- Columns (D1-D5): Represent the Dynamic State (D1=Overextended Up, D3=Neutral, D5=Overextended Down).
- Active Cell: Marked with a dot, indicating the specific intersection of price action and market structure.
4. Matrix Interpretations (The 25 Scenarios)
Below is the detailed logic for every possible state displayed on the dashboard, explaining the Title, Bias, and actionable Signal.
Section I: S1 - Static Breakout (Price > Static Resistance)
The price has cleared the static volume resistance zone.
- S1 / D1: HYPER EXTENSION
Bias: Extreme Bullish
Signal: Caution: Exhaustion Risk. Trail stops tight.
- S1 / D2: RESISTANCE CLASH
Bias: Bullish
Signal: Breakout confirmed but facing immediate dynamic resistance.
- S1 / D3: CHANNEL BREAKOUT
Bias: Strong Bullish
Signal: Ideal Trend Continuation. Look to buy dips.
- S1 / D4: SMART PULLBACK
Bias: Bullish (Pullback)
Signal: A pullback occurring after a breakout. Strong buy opportunity.
- S1 / D5: CONFLICT (DIV)
Bias: Conflict/Reversal
Signal: Major Divergence. Static breakout is failing against dynamic structure. High Risk.
Section II: S2 - Inside Static Resistance
The price is currently testing the overhead resistance zone.
- S2 / D1: WEAK SPIKE
Bias: Neutral/Bullish
Signal: Testing resistance, but short-term overextended.
- S2 / D2: IRON FORTRESS (R)
Bias: Rejection Risk
Signal: Double Resistance (Static + Dynamic). High probability of rejection.
- S2 / D3: TESTING RES
Bias: Neutral
Signal: Consolidating at resistance. Wait for a clear break or rejection.
- S2 / D4: COMPRESSION (UP)
Bias: Conflict (Squeeze)
Signal: Squeezed between Static Resistance and Dynamic Support. Volatility imminent.
- S2 / D5: RES vs DOWN-TREND
Bias: Bearish
Signal: Strong downtrend meeting static resistance. Potential Short entry.
Section III: S3 - Mid-Range
The price is floating between significant Static Support and Resistance.
- S3 / D1: OVERBOUGHT RANGE
Bias: Rejection Risk (OB)
Signal: Overextended within the range. Potential fade (short).
- S3 / D2: RANGE HIGH LIMIT
Bias: Neutral/Bearish
Signal: At the top of the dynamic channel. Look for rejection signs.
- S3 / D3: NEUTRAL / CHOPPY
Bias: Neutral
Signal: Dead Center. Low probability environment. Avoid trading.
- S3 / D4: RANGE DIP BUY
Bias: Neutral/Bullish
Signal: At the bottom of the dynamic channel. Look for bounce signs.
- S3 / D5: WEAK RANGE (OS)
Bias: Bounce Risk (OS)
Signal: Oversold within the range. Potential fade (long).
Section IV: S4 - Inside Static Support
The price is currently testing the floor support zone.
- S4 / D1: SUP vs UP-TREND
Bias: Bullish
Signal: Strong uptrend meeting static support. Potential Long entry.
- S4 / D2: COMPRESSION (DN)
Bias: Conflict (Squeeze)
Signal: Squeezed between Static Support and Dynamic Resistance. Volatility imminent.
- S4 / D3: TESTING SUPPORT
Bias: Neutral
Signal: Consolidating at support. Wait for a bounce or breakdown.
- S4 / D4: IRON FLOOR (S)
Bias: Bounce Risk
Signal: Double Support (Static + Dynamic). High probability of a bounce.
- S4 / D5: WEAK DIP
Bias: Neutral/Bearish
Signal: Testing support, but short-term oversold.
Section V: S5 - Static Breakdown (Price < Static Support)
The price has dropped below the static volume support zone.
- S5 / D1: CONFLICT (DIV)
Bias: Conflict/Reversal
Signal: Major Divergence. Static breakdown is failing. High Risk.
- S5 / D2: BEAR PULLBACK
Bias: Bearish (Pullback)
Signal: A pullback occurring after a breakdown. Strong selling opportunity.
- S5 / D3: CHANNEL BREAKDOWN
Bias: Strong Bearish
Signal: Ideal Trend Continuation (Down). Sell rallies.
- S5 / D4: SUPPORT CLASH
Bias: Bearish
Signal: Breakdown confirmed but facing immediate dynamic support.
- S5 / D5: HYPER DROP (VOID)
Bias: Extreme Bearish
Signal: Caution: Climax risk. Trail stops for shorts.
DISCLAIMER & EDUCATIONAL PURPOSE
This indicator is strictly an educational tool designed to visualize complex market structure concepts. Its primary purpose is to help traders "bridge the gap" between academic theory and real-time market behavior by providing a visual representation of support, resistance, and volume dynamics.
Please Note:
1. Not a Trading Strategy: This script is an analytical assistant, not a standalone "Black Box" trading system. It does not generate buy or sell signals that should be followed blindly.
2. No Financial Advice: The data provided by this tool is for informational purposes only. It is not a recommendation to buy or sell any asset.
3. Risk Warning: Trading involves significant risk. Always use your own judgment, perform your own technical analysis, and use proper risk management. Do not use this tool as the sole basis for your trading decisions.
4. Data Precision & Platform Limits: The "Intrabar (Precise)" calculation mode relies on high-resolution historical data to provide exact results. Access to this specific data depth depends entirely on your platform's subscription capabilities. If your plan does not support this level of historical intrabar data, the Precise mode may have limited coverage. In that case, you should switch to "Geometry" mode for a fully populated view.
1. Introduction & Methodology
The DSRTL indicator is designed to provide a multidimensional analysis of market structure. Unlike traditional tools that rely solely on price pivots, this script combines Static Volume-based Zones with Dynamic Trend Lines to evaluate the price's position relative to critical market components.
The S/R Identification Technique
Instead of standard pivot points, DSRTL utilizes Volume Analysis to highlight areas of significant trader participation:
- Strategy A:
Matrix Climax: Identifies candles within the lookback period that are near price extremes (Highs/Lows) and coincide with significant buying or selling volume.
- Strategy B:
Volume Extremes: Detects candles with the absolute highest buy/sell volumes within the selected lookback window, creating extreme volume-based S/R zones.
- Result:
This creates Support/Resistance (S/R) zones that are validated by actual market activity, not just price geometry.
Dynamic Trend Lines
To complement the static zones, the indicator employs two adaptive channel methods:
- Pivot Span: Connects recent significant pivots for a fast, reactive trend corridor.
- 5-Point Channel: Segments the lookback period into 5 parts to perform a linear regression analysis, creating a stable and statistically significant channel.
2. Volume Calculation Methodology
Accurate S/R detection requires distinguishing Buy Volume from Sell Volume. DSRTL offers two calculation modes:
- Geometry (Source File): Estimates buy/sell volume based on the Close price's position relative to the High/Low of the candle.
Note: This is an approximation that works on all plan types as it does not require intrabar data.
- Intrabar (Precise): Analyzes historical lower-timeframe data (e.g., 15S) to calculate intrabar-based volume deltas with higher precision compared to the geometric method.
Note: This offers superior accuracy. It requires access to historical intrabar data (depending on your plan limits). For the best analytical results, use this mode if available.
3. The Smart Matrix Engine (3D Analysis)
The core of DSRTL is its dashboard, powered by the "Smart Matrix Engine." This engine evaluates the current price in a multi-layer market structure context (Static Volume Zones + Dynamic Channels + Volume Metrics).:
A. S-State (Static): Where is the price relative to the Volume S/R zones?
B. D-State (Dynamic): Where is the price relative to the Trend Channels?
How to read the Matrix Map:
The dashboard displays a 5x5 grid representing 25 possible market scenarios.
- Rows (S1-S5): Represent the Static State (S1=Breakout, S3=Mid-Range, S5=Breakdown).
- Columns (D1-D5): Represent the Dynamic State (D1=Overextended Up, D3=Neutral, D5=Overextended Down).
- Active Cell: Marked with a dot, indicating the specific intersection of price action and market structure.
4. Matrix Interpretations (The 25 Scenarios)
Below is the detailed logic for every possible state displayed on the dashboard, explaining the Title, Bias, and actionable Signal.
Section I: S1 - Static Breakout (Price > Static Resistance)
The price has cleared the static volume resistance zone.
- S1 / D1: HYPER EXTENSION
Bias: Extreme Bullish
Signal: Caution: Exhaustion Risk. Trail stops tight.
- S1 / D2: RESISTANCE CLASH
Bias: Bullish
Signal: Breakout confirmed but facing immediate dynamic resistance.
- S1 / D3: CHANNEL BREAKOUT
Bias: Strong Bullish
Signal: Ideal Trend Continuation. Look to buy dips.
- S1 / D4: SMART PULLBACK
Bias: Bullish (Pullback)
Signal: A pullback occurring after a breakout. Strong buy opportunity.
- S1 / D5: CONFLICT (DIV)
Bias: Conflict/Reversal
Signal: Major Divergence. Static breakout is failing against dynamic structure. High Risk.
Section II: S2 - Inside Static Resistance
The price is currently testing the overhead resistance zone.
- S2 / D1: WEAK SPIKE
Bias: Neutral/Bullish
Signal: Testing resistance, but short-term overextended.
- S2 / D2: IRON FORTRESS (R)
Bias: Rejection Risk
Signal: Double Resistance (Static + Dynamic). High probability of rejection.
- S2 / D3: TESTING RES
Bias: Neutral
Signal: Consolidating at resistance. Wait for a clear break or rejection.
- S2 / D4: COMPRESSION (UP)
Bias: Conflict (Squeeze)
Signal: Squeezed between Static Resistance and Dynamic Support. Volatility imminent.
- S2 / D5: RES vs DOWN-TREND
Bias: Bearish
Signal: Strong downtrend meeting static resistance. Potential Short entry.
Section III: S3 - Mid-Range
The price is floating between significant Static Support and Resistance.
- S3 / D1: OVERBOUGHT RANGE
Bias: Rejection Risk (OB)
Signal: Overextended within the range. Potential fade (short).
- S3 / D2: RANGE HIGH LIMIT
Bias: Neutral/Bearish
Signal: At the top of the dynamic channel. Look for rejection signs.
- S3 / D3: NEUTRAL / CHOPPY
Bias: Neutral
Signal: Dead Center. Low probability environment. Avoid trading.
- S3 / D4: RANGE DIP BUY
Bias: Neutral/Bullish
Signal: At the bottom of the dynamic channel. Look for bounce signs.
- S3 / D5: WEAK RANGE (OS)
Bias: Bounce Risk (OS)
Signal: Oversold within the range. Potential fade (long).
Section IV: S4 - Inside Static Support
The price is currently testing the floor support zone.
- S4 / D1: SUP vs UP-TREND
Bias: Bullish
Signal: Strong uptrend meeting static support. Potential Long entry.
- S4 / D2: COMPRESSION (DN)
Bias: Conflict (Squeeze)
Signal: Squeezed between Static Support and Dynamic Resistance. Volatility imminent.
- S4 / D3: TESTING SUPPORT
Bias: Neutral
Signal: Consolidating at support. Wait for a bounce or breakdown.
- S4 / D4: IRON FLOOR (S)
Bias: Bounce Risk
Signal: Double Support (Static + Dynamic). High probability of a bounce.
- S4 / D5: WEAK DIP
Bias: Neutral/Bearish
Signal: Testing support, but short-term oversold.
Section V: S5 - Static Breakdown (Price < Static Support)
The price has dropped below the static volume support zone.
- S5 / D1: CONFLICT (DIV)
Bias: Conflict/Reversal
Signal: Major Divergence. Static breakdown is failing. High Risk.
- S5 / D2: BEAR PULLBACK
Bias: Bearish (Pullback)
Signal: A pullback occurring after a breakdown. Strong selling opportunity.
- S5 / D3: CHANNEL BREAKDOWN
Bias: Strong Bearish
Signal: Ideal Trend Continuation (Down). Sell rallies.
- S5 / D4: SUPPORT CLASH
Bias: Bearish
Signal: Breakdown confirmed but facing immediate dynamic support.
- S5 / D5: HYPER DROP (VOID)
Bias: Extreme Bearish
Signal: Caution: Climax risk. Trail stops for shorts.
DISCLAIMER & EDUCATIONAL PURPOSE
This indicator is strictly an educational tool designed to visualize complex market structure concepts. Its primary purpose is to help traders "bridge the gap" between academic theory and real-time market behavior by providing a visual representation of support, resistance, and volume dynamics.
Please Note:
1. Not a Trading Strategy: This script is an analytical assistant, not a standalone "Black Box" trading system. It does not generate buy or sell signals that should be followed blindly.
2. No Financial Advice: The data provided by this tool is for informational purposes only. It is not a recommendation to buy or sell any asset.
3. Risk Warning: Trading involves significant risk. Always use your own judgment, perform your own technical analysis, and use proper risk management. Do not use this tool as the sole basis for your trading decisions.
4. Data Precision & Platform Limits: The "Intrabar (Precise)" calculation mode relies on high-resolution historical data to provide exact results. Access to this specific data depth depends entirely on your platform's subscription capabilities. If your plan does not support this level of historical intrabar data, the Precise mode may have limited coverage. In that case, you should switch to "Geometry" mode for a fully populated view.
Skrip open-source
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Pernyataan Penyangkalan
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Skrip open-source
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Pernyataan Penyangkalan
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.