OPEN-SOURCE SCRIPT
Updated SBP Structured Trend Indicator

# SBP Structured Trend Indicator
## Overview
SBP Structured Trend Indicator is a trend-following decision support tool designed to evaluate market structure through multiple layers of confirmation instead of relying on a single technical indicator.
Rather than generating signals from one moving average crossover or momentum oscillator, the indicator evaluates the agreement between several independent market characteristics before identifying a potential trading opportunity. The objective is to reduce low-quality signals while remaining responsive to changing market conditions.
The indicator automatically adapts its internal parameters for Scalping, Intraday and Swing trading modes so that the same methodology can be applied across different trading styles.
---
## Methodology
The indicator combines several analytical engines, each measuring a different aspect of market behaviour.
### 1. Structured Trend Engine
The primary trend is determined from a smoothed directional filter that measures both trend direction and trend slope. This establishes the dominant market bias before any trading signals are evaluated.
---
### 2. Adaptive Trend Smoothing
An adaptive moving average is used to smooth price movement while reducing lag during directional trends. The slope of this adaptive average is used as an additional confirmation of market direction instead of relying solely on price crossing a moving average.
---
### 3. Trend Consensus Engine
A fast and slow exponential average are evaluated together to estimate trend agreement. Rather than treating a crossover as a signal by itself, the distance between the averages is used to estimate trend strength.
This helps distinguish established trends from weak directional movement.
---
### 4. Volatility Assessment
Current market volatility is compared with its recent average using the Average True Range (ATR).
This allows the indicator to distinguish between expanding and contracting market conditions so that stronger trends receive greater confidence than periods of low activity.
---
### 5. Momentum Evaluation
Momentum is measured using the rate of price change together with recent candle direction.
Momentum confirmation is evaluated alongside the prevailing trend rather than acting as an independent entry trigger.
---
### 6. Trend Confidence Score
A confidence score is calculated from several independent observations, including:
• Momentum strength
• Trend persistence
• Trend strength
• Relative trading volume
The resulting confidence score allows traders to select Aggressive, Balanced or Conservative filtering depending on their preferred trading style.
---
### 7. Position State Logic
The indicator tracks the current directional state to avoid repeatedly issuing identical signals during the same market move.
A new Buy signal is generated only after market conditions support a new bullish transition, while Sell signals follow the same principle for bearish conditions.
This design aims to reduce repetitive alerts during sustained trends.
---
## Trading Modes
### Scalping
Uses shorter internal lookback periods to respond more quickly to short-term price movement.
### Intraday
Balances responsiveness and stability for session-based trading.
### Swing
Uses longer adaptive calculations intended to identify broader market trends while filtering short-term fluctuations.
---
## Dashboard
The optional dashboard summarizes the current analytical state, including:
• Selected trading mode
• Current trend direction
• Market regime
• Trend confidence score
• Latest signal status
The dashboard is intended as a quick reference and should not replace chart analysis.
---
## Suggested Usage
The indicator is designed to be used alongside price action, support and resistance, market structure and prudent risk management.
It is not intended to predict future prices or guarantee profitable trades. Instead, it provides a structured framework for evaluating trend quality and identifying higher-confidence trading opportunities.
As with any analytical tool, users should evaluate signals within the broader market context and test the indicator on instruments and timeframes appropriate to their trading approach.
## Overview
SBP Structured Trend Indicator is a trend-following decision support tool designed to evaluate market structure through multiple layers of confirmation instead of relying on a single technical indicator.
Rather than generating signals from one moving average crossover or momentum oscillator, the indicator evaluates the agreement between several independent market characteristics before identifying a potential trading opportunity. The objective is to reduce low-quality signals while remaining responsive to changing market conditions.
The indicator automatically adapts its internal parameters for Scalping, Intraday and Swing trading modes so that the same methodology can be applied across different trading styles.
---
## Methodology
The indicator combines several analytical engines, each measuring a different aspect of market behaviour.
### 1. Structured Trend Engine
The primary trend is determined from a smoothed directional filter that measures both trend direction and trend slope. This establishes the dominant market bias before any trading signals are evaluated.
---
### 2. Adaptive Trend Smoothing
An adaptive moving average is used to smooth price movement while reducing lag during directional trends. The slope of this adaptive average is used as an additional confirmation of market direction instead of relying solely on price crossing a moving average.
---
### 3. Trend Consensus Engine
A fast and slow exponential average are evaluated together to estimate trend agreement. Rather than treating a crossover as a signal by itself, the distance between the averages is used to estimate trend strength.
This helps distinguish established trends from weak directional movement.
---
### 4. Volatility Assessment
Current market volatility is compared with its recent average using the Average True Range (ATR).
This allows the indicator to distinguish between expanding and contracting market conditions so that stronger trends receive greater confidence than periods of low activity.
---
### 5. Momentum Evaluation
Momentum is measured using the rate of price change together with recent candle direction.
Momentum confirmation is evaluated alongside the prevailing trend rather than acting as an independent entry trigger.
---
### 6. Trend Confidence Score
A confidence score is calculated from several independent observations, including:
• Momentum strength
• Trend persistence
• Trend strength
• Relative trading volume
The resulting confidence score allows traders to select Aggressive, Balanced or Conservative filtering depending on their preferred trading style.
---
### 7. Position State Logic
The indicator tracks the current directional state to avoid repeatedly issuing identical signals during the same market move.
A new Buy signal is generated only after market conditions support a new bullish transition, while Sell signals follow the same principle for bearish conditions.
This design aims to reduce repetitive alerts during sustained trends.
---
## Trading Modes
### Scalping
Uses shorter internal lookback periods to respond more quickly to short-term price movement.
### Intraday
Balances responsiveness and stability for session-based trading.
### Swing
Uses longer adaptive calculations intended to identify broader market trends while filtering short-term fluctuations.
---
## Dashboard
The optional dashboard summarizes the current analytical state, including:
• Selected trading mode
• Current trend direction
• Market regime
• Trend confidence score
• Latest signal status
The dashboard is intended as a quick reference and should not replace chart analysis.
---
## Suggested Usage
The indicator is designed to be used alongside price action, support and resistance, market structure and prudent risk management.
It is not intended to predict future prices or guarantee profitable trades. Instead, it provides a structured framework for evaluating trend quality and identifying higher-confidence trading opportunities.
As with any analytical tool, users should evaluate signals within the broader market context and test the indicator on instruments and timeframes appropriate to their trading approach.
Release Notes
SBP Structured Trend Indicator SBP Structured Trend Indicator is a trend and market-structure analysis tool designed to organize several related technical conditions into a single rule-based framework.
The script combines trend direction, adaptive smoothing, EMA alignment, ATR-normalized momentum, price structure, candle characteristics, optional relative-volume analysis, and volatility conditions. These components are combined because each evaluates a different aspect of market behaviour. Rather than treating them as independent signals, the indicator uses them together to identify periods where multiple analytical conditions are aligned.
How the Indicator Works
The Structured Trend Engine evaluates price position and the slope of a smoothed trend filter.
A Hull-style Adaptive Average provides an additional view of directional price movement, while the EMA Trend Ribbon compares faster and slower averages to assess directional alignment and trend separation.
Momentum is measured using price movement normalized by Average True Range (ATR). ATR normalization is used so that momentum is evaluated relative to the recent volatility of the charted symbol.
The Price Structure Engine compares the current closing price with previous-bar structure levels. The current setup candle is excluded from its own structure reference.
The Candle Quality Engine evaluates candle body proportion and closing location within the candle range. An optional Relative Volume Filter can also be enabled where usable volume data is available.
A volatility filter compares current ATR with its recent average and can restrict setup markers during unusually expanded volatility conditions.
Trend Phase Lock
The indicator includes a Trend Phase Lock designed to control repeated same-direction setup markers.
A directional phase is established only after trend conditions remain aligned for the required number of bars. Temporary neutral or transition bars do not automatically reset the active phase.
After a primary BUY or SELL setup marker appears, the same directional phase is marked as used. Another primary marker in the same direction is restricted until an opposite directional phase becomes established.
This mechanism is intended to reduce repeated markers during an ongoing directional move. It is a signal-frequency control method and does not predict future price direction.
Quality Score
The indicator calculates a direction-specific quality score from the analytical components enabled by the user.
Trend strength and directional alignment form the core of the score. Momentum, candle quality, price structure, and relative volume contribute only when their corresponding filters are enabled.
The score is normalized according to the active components. For example, when the Relative Volume Filter is disabled, volume does not contribute points or denominator weight to the calculated quality percentage.
The available Signal Quality settings are:
Aggressive – uses less restrictive analytical thresholds.
Balanced – applies moderate quality requirements.
Conservative – applies stricter trend, momentum, and candle-quality requirements.
Signal Frequency
Three signal-frequency settings are provided:
Selective – requires stronger quality conditions and additional phase confirmation.
Balanced – uses moderate phase and quality requirements.
Frequent – uses less restrictive phase confirmation and quality requirements.
Signal Frequency changes the selectivity of the rule-based setup engine. It does not represent an expected success rate.
BUY and SELL Setup Labels
BUY and SELL labels identify bars where the script's enabled trend, momentum, structure, candle, volatility, distance, phase, and quality conditions satisfy the selected settings.
These labels represent rule-based analytical setups generated by the script. They are not trade execution commands, guarantees, or predictions of future market movement.
When Signals On Bar Close is enabled, setup markers and related alerts are evaluated after the chart bar closes.
Early Transition Markers
Optional Early Transition Markers identify selected changes around the trend filter where directional slope, adaptive trend direction, EMA alignment, momentum, and candle conditions meet the script's transition rules.
These markers are separate from the primary BUY and SELL setup engine and do not reset or unlock the Trend Phase Lock.
Early Transition Markers are disabled by default to maintain a cleaner chart.
Maximum Signal Distance
The Maximum Signal Distance setting measures the distance between price and the Adaptive Average in ATR units.
This filter can restrict primary setup markers when price has moved beyond the user-selected distance from the adaptive trend reference.
ATR Risk Guide
The optional ATR Risk Guide plots a volatility-based analytical reference around the Adaptive Average.
It is provided only as a visual risk-analysis guide. It is not a broker order, automated exit, or guaranteed stop level.
Dashboard
The optional dashboard displays the current trading mode, signal-frequency setting, trend state, active directional phase, phase-signal status, quality score, market regime, and current setup state.
Important Information
This indicator is provided for educational and informational purposes as a technical-analysis and decision-support tool.
BUY and SELL labels identify rule-based analytical conditions defined in the script. They do not constitute financial advice, automated trade execution, or a guarantee of future market performance.
The indicator does not place orders or manage positions. Users remain responsible for their own analysis, trading decisions, position sizing, and risk management.
Past performance does not guarantee future results.
Release Notes
SBP Structured Trend Indicator is a rule-based analytical indicator that studies how price responds to confirmed structural reference levels. Rather than relying on a single trend indicator or combining unrelated technical studies, it follows one integrated structural-response methodology in which every calculation contributes to the same analytical process.The indicator first identifies confirmed structural reference levels from pivot-based market structure. Nearby confirmed pivots are grouped into structural memory levels using an ATR-normalized clustering process so that repeatedly respected price areas become stronger over time while isolated pivots receive less importance. The objective is to analyse how price behaves when interacting with established structural levels instead of reacting to every short-term fluctuation.
After structural levels are established, the indicator evaluates several different types of price interaction. These include controlled rejection from a structural level, accepted movement followed by reclaim, decisive structural-level failure, repeated directional pressure before release, delayed structural-break confirmation, and confirmed structural turning points. These are not separate indicators operating independently; they represent different stages of the same structural-response framework.
Each potential event is evaluated using multiple objective measurements before becoming eligible for a signal. The qualification process considers ATR-normalized penetration distance, candle structure, wick behaviour, closing location within the candle, structural-memory strength, displacement from confirmed pivots, and optional relative-volume participation when suitable volume data is available. These measurements are combined into quality scores designed to reduce low-quality structural interactions.
All qualified events pass through a single signal-management engine that applies confirmation rules, signal alternation, and cooldown periods before displaying BUY or SALE labels or generating alerts. This unified routing process helps reduce repeated same-direction signals while maintaining consistent behaviour across all structural-response event types.
The indicator provides two analytical profiles. Intraday mode evaluates the complete structural-response framework, including pressure-release and structural-break memory events, while Swing mode applies a slower structural-memory profile intended for analysing broader price movement using the same underlying methodology.
Structural reference levels are derived from confirmed pivots, so newly identified levels become available only after the required confirmation bars have completed. This confirmation process intentionally introduces a delay but helps reduce unstable pivot identification. Confirmed structural-turn signals are displayed only after confirmation and are not plotted retrospectively on earlier candles.
By default, signals are confirmed only after the current chart bar has closed. If bar-close confirmation is disabled, signals on the active candle may change until that candle is completed because the final candle characteristics have not yet been confirmed.
This script is an analytical indicator, not a trading strategy. It does not place trades, calculate position sizing, manage risk, estimate profitability, or predict future market direction. Its purpose is to provide a structured framework for analysing how price interacts with confirmed structural reference levels. Traders should use its output together with their own analysis, market context, and risk-management methodology.
Open-source script
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.
S B Prasad Trading Ecosystem Email sbptradingecosystem@gmail.com, Mobile no 9903367725
Disclaimer
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.
Open-source script
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.
S B Prasad Trading Ecosystem Email sbptradingecosystem@gmail.com, Mobile no 9903367725
Disclaimer
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.