OPEN-SOURCE SCRIPT
Aggiornato

SBP Structured Trend Indicator

699
# 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.
Note di rilascio
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.
Note di rilascio
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.
Note di rilascio
SBP Structured Trend Indicator is a rule-based market analysis tool built around a proprietary Directional Phase Engine. The script evaluates market behaviour through a unified analytical workflow that measures directional energy, phase development, trend persistence, and transition confidence before displaying a BUY or SALE signal.

The indicator derives its analysis from the relationship between candle structure, directional pressure, normalized market movement, and confirmed phase transitions. Each component contributes to a single analytical framework, where every calculation supports the overall evaluation of market phases .

How the Indicator Works

The analytical process follows several sequential stages:

1. Directional Energy Analysis

Each completed candle contributes to a proprietary directional energy model that evaluates:

Relative body position
Closing pressure
Wick behaviour
Normalized price expansion

These measurements are combined into a normalized energy value representing the balance between buying and selling pressure.

2. Phase Detection

The energy model is evaluated over fast and slow response cycles to determine whether the market is developing:

Bullish Expansion
Bullish Pullback
Bearish Expansion
Bearish Pullback
Neutral Transition

This state-machine approach allows the indicator to distinguish temporary pullbacks from genuine directional reversals.

3. Quality Confirmation

Potential phase changes must satisfy additional qualification criteria before becoming valid directional phases.

These include:

Directional consistency
Market range quality
Closing strength
Multi-bar confirmation

This filtering process is intended to reduce isolated or weak directional fluctuations that do not represent meaningful changes in market behaviour.

4. Adaptive Phase Guide

Instead of using a traditional trailing stop or moving-average line, the indicator plots an Adaptive Phase Guide.

The guide is generated from the internal analytical model using:

Current phase direction
Directional persistence
Energy balance
Phase maturity
Confidence weighting
Adaptive smoothing

Because the guide is derived entirely from the indicator's internal calculations, it is designed to represent the evolution of directional phases rather than acting as a conventional support, resistance, or stop-loss line.

5. Signal Routing

BUY and SALE signals are managed through a centralized signal-routing engine.

The indicator issues only one qualified signal for each confirmed directional phase. Once a BUY has been generated, another BUY cannot occur until the analytical model confirms a valid bearish phase. The same principle applies in reverse for SALE signals.

This state-driven routing helps prevent repeated signals during the same directional movement and focuses attention on confirmed phase transitions.

Intended Use

SBP Structured Trend Indicator is designed for traders who prefer structured, rule-based market analysis. It can be used to monitor changes in directional market behaviour, identify confirmed phase transitions, and visualize the progression of market structure through its Adaptive Phase Guide.

The indicator is intended as an analytical aid and should be used alongside the user's own trading plan, market analysis, and risk management process.

Important Information
This script is an indicator, not a trading strategy.
It does not place trades or manage positions.
Signals are generated only after bar confirmation and are not intended to predict future price movement before confirmation.
No single indicator should be used as the sole basis for trading decisions. Users should always consider broader market context and appropriate risk management before taking any position.
Note di rilascio
SBP Structured Trend Indicator is a rule-based technical analysis indicator designed to evaluate the balance of buying and selling pressure through a unified analytical framework. Instead of relying on a single technical measure, the indicator combines multiple price-action characteristics into one structured model that estimates whether buyers or sellers are gaining control of the market.

The objective is not to predict future prices or generate trading recommendations. Rather, it provides an objective view of market conditions by measuring the interaction between directional price movement, persistence of pressure, price acceptance, volatility behaviour and candle structure.

Methodology

The indicator follows a single analytical workflow in which each component contributes to a composite market pressure index.

Directional Pressure

The first stage evaluates the relationship between:

candle body size
closing position within the candle range
upper and lower wick characteristics
range expansion relative to recent market activity

These measurements estimate whether buying or selling pressure dominated during the formation of each completed candle.

Pressure Persistence

Short-term pressure can often fluctuate during normal market noise. The indicator therefore evaluates whether bullish or bearish pressure is being maintained over multiple bars instead of reacting to isolated candles.

Persistent directional pressure contributes more heavily to the final market assessment than temporary fluctuations.

Price Acceptance

The indicator calculates an equilibrium price using a moving average of typical price and measures the distance between current price and this equilibrium in ATR-normalized units.

Price that continues to be accepted above equilibrium strengthens bullish conditions, while sustained acceptance below equilibrium strengthens bearish conditions.

Liquidity Absorption

Candles with long rejection wicks may indicate that aggressive buying or selling pressure has been absorbed.

The indicator incorporates these rejection characteristics as additional evidence supporting the prevailing directional pressure rather than treating them as standalone reversal signals.

Volatility Compression and Expansion

Periods of reduced volatility frequently precede directional expansion.

The indicator evaluates:

ATR compression
subsequent range expansion
direction of emerging pressure

This information is incorporated into the overall market pressure assessment instead of generating independent breakout signals.

Composite Market Pressure Index

All analytical components are combined into a normalized composite pressure index. This index represents the overall balance between bullish and bearish market control.

The structured trendline displayed on the chart is derived from this composite pressure index and projected around an equilibrium price using ATR-based scaling. The line is coloured green when bullish pressure dominates and red when bearish pressure dominates.

Signal Generation

BUY and SALE signals are produced only after multiple confirmation conditions are satisfied.

The signal engine evaluates:

pressure improvement
pressure persistence
price acceptance
candle quality
liquidity absorption
configurable quality threshold
confirmed bar close

Signals also follow a strict alternating sequence, ensuring that consecutive BUY or consecutive SALE signals are not produced without an intervening signal in the opposite direction.

This helps reduce repeated signals during extended trends while maintaining consistent analytical behaviour.

Features
Unified pressure-based analytical framework
Composite market pressure model
Structured green/red trendline
Price acceptance analysis
Volatility compression and expansion assessment
Liquidity absorption detection
Confirmed BUY and SALE signals
Configurable signal quality controls
Alternating signal logic
Confirmed-bar alert conditions
How to Use

Many traders use the indicator to monitor changes in directional market pressure rather than treating individual signals as standalone decisions.

Possible analytical observations include:

Green structured trendline indicates bullish pressure currently exceeds bearish pressure.
Red structured trendline indicates bearish pressure currently exceeds bullish pressure.
BUY signals identify confirmed transitions toward increasing bullish pressure.
SALE signals identify confirmed transitions toward increasing bearish pressure.

The indicator may be used alongside a trader's own market analysis, trading plan and risk management process.

Disclaimer

SBP Structured Trend Indicator is an analytical indicator and not a trading strategy. It does not place trades, predict future market movements, calculate position sizing or manage trading risk. All trading decisions remain the responsibility of the user.
Note di rilascio
SBP Structured Trend Indicator is a bar market analysis tool designed to identify changes in directional structure while maintaining a clean and easy-to-read chart. It displays an adaptive structured trendline together with an alternating sequence of BUY and SALE signals.

The indicator evaluates multiple market characteristics through a unified calculation process. Candle pressure, price structure, momentum, directional participation, volume behaviour and exhaustion evidence contribute to a weighted bullish or bearish assessment before a signal is accepted.

Method

The indicator is based on the principle that directional changes become more reliable when several independent market characteristics support the same conclusion.

The calculation process evaluates:

Price location relative to internal structure references.
Direction and slope of the phase reference.
ATR-normalised momentum.
Candle pressure derived from body efficiency, wick balance and closing location.
Directional pressure and persistence.
Volume participation and effort-versus-result behaviour.
Exhaustion near recent structural extremes.

Each component contributes weighted evidence rather than acting as a standalone trigger. A BUY or SALE signal is generated only when the combined evidence exceeds the required confirmation threshold.

Volume Participation

The indicator evaluates volume as a measure of market participation rather than using a simple volume-above-average condition.

Current volume is compared with a rolling reference while directional volume flow is estimated from candle positioning. Trading effort is also compared with actual price progress to help distinguish between:

directional participation supporting price movement;
increased activity with limited progress, which may indicate absorption;
low-participation moves requiring additional confirmation.

When reliable volume data is unavailable, the volume component automatically becomes neutral.

Structure and Trend

The internal structure model uses adaptive fast, slow and phase references together with ATR-normalised price distance to evaluate market direction.

The structured trendline combines equilibrium with directional pressure and automatically adjusts its smoothing according to instrument type and recent volatility. The line displays:

Green when the smoothed directional bias is rising.
Red when the smoothed directional bias is falling.

Higher volatility places greater emphasis on slower smoothing, while lower volatility allows a more responsive trendline.

Exhaustion Assessment

When price reaches a recent structural extreme, the indicator evaluates additional evidence including:

shrinking candle bodies;
flattening phase movement;
weakening momentum;
weakening directional pressure;
rejection wicks;
slowing ADX expansion.

This process identifies potential distribution or accumulation conditions. A reversal signal is generated only after sufficient bullish or bearish confirmation is present.

Signal Logic

The master signal process maintains the sequence:

BUY → SALE → BUY → SALE

Duplicate BUY signals are not produced while the bullish state remains active, and duplicate SALE signals are not produced while the bearish state remains active.

The indicator does not rely on a fixed minimum number of candles between signals. Direction changes occur only when confirmed opposite evidence becomes sufficiently stronger than the existing directional evidence.

Inputs

Show BUY / SALE – Displays or hides the master BUY and SALE signals.

Show Structured Trendline – Displays or hides the adaptive structured trendline.

Response Mode – Responsive, Balanced and Conservative profiles adjust sensitivity and confirmation requirements.

Use Volume Participation – Enables or neutralises the volume participation model.

Volume Reference Length – Defines the rolling volume comparison period.

Minimum Relative Volume – Sets the minimum participation level used for volume qualification.

Suggested Use

Apply the indicator to a clean candlestick chart. Balanced mode provides the standard operating profile.

The trendline colour can be used to assess directional context, while BUY and SALE labels indicate confirmed changes in the internal directional state. Signals are generated only after the bar closes and are not moved to earlier candles.

Alerts

BUY and SALE alert conditions correspond directly to the signals displayed on the chart and can be used with any supported symbol or timeframe.

Limitations

This indicator is intended for market analysis and educational purposes. It does not place orders, calculate position size, determine stop-loss levels or predict future prices. Market conditions, liquidity, data quality and execution methods may influence trading results. Users should evaluate the indicator using their own symbols, timeframes and risk-management approach before making trading decisions.

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.