OPEN-SOURCE SCRIPT
ที่อัปเดต: SBP SBP Trend Phase Navigator

SBP Trend Phase Navigator
SBP Trend Phase Navigator is a rule-based technical analysis indicator designed to study directional trend phases and identify selected analytical setups when multiple chart conditions align.
Purpose and Component Integration
The indicator combines trend direction, adaptive smoothing, EMA alignment, ATR-normalized momentum, price structure, candle characteristics, optional relative volume, and volatility analysis.
These components are combined because they evaluate different aspects of price behaviour. Trend calculations provide directional context, momentum measures the strength of recent price movement relative to volatility, price structure evaluates movement beyond previous chart levels, and candle analysis examines the characteristics of the current bar.
The script processes these conditions within one rule-based framework rather than treating each component as an independent signal source.
Trend Analysis
The trend engine evaluates price in relation to a smoothed trend filter and measures the direction of the filter's slope.
A fast and slow EMA pair is used to assess directional alignment. The distance between these averages is normalized using Average True Range (ATR) and forms part of the trend-strength calculation.
A Hull-style adaptive average provides an additional directional reference. Its slope is evaluated together with the trend filter and EMA alignment when determining bullish or bearish trend conditions.
ATR-Normalized Momentum
Momentum is calculated from price change over a mode-dependent lookback period and divided by ATR.
This allows the script to evaluate recent directional price movement relative to the instrument's recent volatility rather than using absolute price movement alone.
Bullish and bearish momentum conditions are calculated separately.
Price Structure and Candle Analysis
The Price Structure Engine compares the current closing price with previous structure highs or lows over a selected lookback period.
The current setup candle is excluded from its own structure reference.
The Candle Quality Engine evaluates the candle body relative to the complete candle range and examines where the candle closes within that range. Bullish and bearish candle conditions are assessed separately.
Optional Relative Volume Analysis
The Relative Volume Filter compares current volume with its recent average where usable volume data is available.
This component is optional because volume characteristics can differ between symbols and markets.
When the volume filter is disabled, volume is excluded from both the score contribution and the available score denominator.
Volatility and Signal Distance
The volatility engine compares current ATR with its recent ATR average. The optional volatility filter can restrict setup markers when the ATR expansion ratio exceeds the selected maximum value.
The Maximum Signal Distance setting measures the distance between price and the Adaptive Average in ATR units. This condition can restrict primary setup markers when price is beyond the selected distance from the adaptive trend reference.
Normalized Quality Score
The indicator calculates separate bullish and bearish quality scores.
Trend strength and directional alignment form the core of the score. Momentum, candle characteristics, price structure, and relative volume contribute when their corresponding components are enabled.
The quality percentage is normalized according to the active scoring components. Disabling an optional component removes its contribution from the score calculation and the available score denominator.
The Aggressive, Balanced, and Conservative quality settings adjust the analytical thresholds used by the script. These settings control rule selectivity and do not represent an expected performance or success rate.
Trend Phase Lock
The Trend Phase Lock is used to control repeated same-direction setup markers.
Bullish and bearish trend conditions are counted over consecutive qualifying bars. A directional phase is established after the selected phase-confirmation requirement is met.
Temporary neutral or transition bars do not automatically reset the active phase.
After a primary BUY or SELL setup marker is generated, the active directional phase is marked as used. The primary setup engine does not generate another same-direction marker during that established phase.
A new primary setup becomes available after an opposite directional phase satisfies the script's phase-confirmation rules.
The Trend Phase Lock is a signal-frequency control mechanism. It does not predict future price direction.
Signal Frequency
The indicator provides Selective, Balanced, and Frequent signal-frequency settings.
Selective applies additional phase confirmation and higher quality requirements.
Balanced uses moderate phase and quality requirements.
Frequent uses less restrictive phase-confirmation and quality requirements.
These settings change the selectivity of the rule-based setup engine.
BUY and SELL Setup Labels
BUY and SELL labels identify bars where the enabled trend, momentum, structure, candle, volume, volatility, signal-distance, quality, and directional-phase conditions satisfy the selected settings.
The primary setup engine permits one setup marker per established directional phase.
When Signals On Bar Close is enabled, primary setup markers and related alert conditions are evaluated after the chart bar closes.
The labels represent rule-based analytical conditions generated by the script. They are not automated orders or guarantees of future price movement.
Early Transition Markers
Optional Early Transition Markers evaluate selected crossings of the trend filter together with trend slope, adaptive trend direction, EMA alignment, momentum direction, candle characteristics, volatility, and signal-distance conditions.
These markers are separate from the primary BUY and SELL setup engine. They do not reset the active phase or unlock another same-direction primary setup.
Early Transition Markers are disabled by default.
ATR Risk Guide and Dashboard
The optional ATR Risk Guide plots a volatility-based analytical reference around the Adaptive Average. It is a visual reference only and is not an automated order, strategy exit, or guaranteed stop level.
The optional dashboard displays the selected mode, signal-frequency setting, current trend state, active directional phase, phase-signal status, normalized quality score, market regime, and current setup state.
Modes and User Controls
The indicator provides SCALPING, INTRADAY, and SWING modes. These modes adjust the internal trend, adaptive-average, momentum, and price-structure lookback lengths.
Users can also control trend-strength, momentum, relative-volume, price-structure, candle-quality, and volatility filters through the indicator settings.
Important Information
SBP Trend Phase Navigator is an analytical and technical-analysis tool intended for educational and informational use.
The indicator evaluates chart data according to defined mathematical and rule-based conditions.
BUY and SELL labels identify analytical setups produced by the script's conditions. They do not constitute financial advice, automated trade execution, or guarantees of future market performance.
The script does not place or manage orders. Users are responsible for their own analysis, trading decisions, position sizing, and risk management.
Past performance does not guarantee future results.
SBP Trend Phase Navigator is a rule-based technical analysis indicator designed to study directional trend phases and identify selected analytical setups when multiple chart conditions align.
Purpose and Component Integration
The indicator combines trend direction, adaptive smoothing, EMA alignment, ATR-normalized momentum, price structure, candle characteristics, optional relative volume, and volatility analysis.
These components are combined because they evaluate different aspects of price behaviour. Trend calculations provide directional context, momentum measures the strength of recent price movement relative to volatility, price structure evaluates movement beyond previous chart levels, and candle analysis examines the characteristics of the current bar.
The script processes these conditions within one rule-based framework rather than treating each component as an independent signal source.
Trend Analysis
The trend engine evaluates price in relation to a smoothed trend filter and measures the direction of the filter's slope.
A fast and slow EMA pair is used to assess directional alignment. The distance between these averages is normalized using Average True Range (ATR) and forms part of the trend-strength calculation.
A Hull-style adaptive average provides an additional directional reference. Its slope is evaluated together with the trend filter and EMA alignment when determining bullish or bearish trend conditions.
ATR-Normalized Momentum
Momentum is calculated from price change over a mode-dependent lookback period and divided by ATR.
This allows the script to evaluate recent directional price movement relative to the instrument's recent volatility rather than using absolute price movement alone.
Bullish and bearish momentum conditions are calculated separately.
Price Structure and Candle Analysis
The Price Structure Engine compares the current closing price with previous structure highs or lows over a selected lookback period.
The current setup candle is excluded from its own structure reference.
The Candle Quality Engine evaluates the candle body relative to the complete candle range and examines where the candle closes within that range. Bullish and bearish candle conditions are assessed separately.
Optional Relative Volume Analysis
The Relative Volume Filter compares current volume with its recent average where usable volume data is available.
This component is optional because volume characteristics can differ between symbols and markets.
When the volume filter is disabled, volume is excluded from both the score contribution and the available score denominator.
Volatility and Signal Distance
The volatility engine compares current ATR with its recent ATR average. The optional volatility filter can restrict setup markers when the ATR expansion ratio exceeds the selected maximum value.
The Maximum Signal Distance setting measures the distance between price and the Adaptive Average in ATR units. This condition can restrict primary setup markers when price is beyond the selected distance from the adaptive trend reference.
Normalized Quality Score
The indicator calculates separate bullish and bearish quality scores.
Trend strength and directional alignment form the core of the score. Momentum, candle characteristics, price structure, and relative volume contribute when their corresponding components are enabled.
The quality percentage is normalized according to the active scoring components. Disabling an optional component removes its contribution from the score calculation and the available score denominator.
The Aggressive, Balanced, and Conservative quality settings adjust the analytical thresholds used by the script. These settings control rule selectivity and do not represent an expected performance or success rate.
Trend Phase Lock
The Trend Phase Lock is used to control repeated same-direction setup markers.
Bullish and bearish trend conditions are counted over consecutive qualifying bars. A directional phase is established after the selected phase-confirmation requirement is met.
Temporary neutral or transition bars do not automatically reset the active phase.
After a primary BUY or SELL setup marker is generated, the active directional phase is marked as used. The primary setup engine does not generate another same-direction marker during that established phase.
A new primary setup becomes available after an opposite directional phase satisfies the script's phase-confirmation rules.
The Trend Phase Lock is a signal-frequency control mechanism. It does not predict future price direction.
Signal Frequency
The indicator provides Selective, Balanced, and Frequent signal-frequency settings.
Selective applies additional phase confirmation and higher quality requirements.
Balanced uses moderate phase and quality requirements.
Frequent uses less restrictive phase-confirmation and quality requirements.
These settings change the selectivity of the rule-based setup engine.
BUY and SELL Setup Labels
BUY and SELL labels identify bars where the enabled trend, momentum, structure, candle, volume, volatility, signal-distance, quality, and directional-phase conditions satisfy the selected settings.
The primary setup engine permits one setup marker per established directional phase.
When Signals On Bar Close is enabled, primary setup markers and related alert conditions are evaluated after the chart bar closes.
The labels represent rule-based analytical conditions generated by the script. They are not automated orders or guarantees of future price movement.
Early Transition Markers
Optional Early Transition Markers evaluate selected crossings of the trend filter together with trend slope, adaptive trend direction, EMA alignment, momentum direction, candle characteristics, volatility, and signal-distance conditions.
These markers are separate from the primary BUY and SELL setup engine. They do not reset the active phase or unlock another same-direction primary setup.
Early Transition Markers are disabled by default.
ATR Risk Guide and Dashboard
The optional ATR Risk Guide plots a volatility-based analytical reference around the Adaptive Average. It is a visual reference only and is not an automated order, strategy exit, or guaranteed stop level.
The optional dashboard displays the selected mode, signal-frequency setting, current trend state, active directional phase, phase-signal status, normalized quality score, market regime, and current setup state.
Modes and User Controls
The indicator provides SCALPING, INTRADAY, and SWING modes. These modes adjust the internal trend, adaptive-average, momentum, and price-structure lookback lengths.
Users can also control trend-strength, momentum, relative-volume, price-structure, candle-quality, and volatility filters through the indicator settings.
Important Information
SBP Trend Phase Navigator is an analytical and technical-analysis tool intended for educational and informational use.
The indicator evaluates chart data according to defined mathematical and rule-based conditions.
BUY and SELL labels identify analytical setups produced by the script's conditions. They do not constitute financial advice, automated trade execution, or guarantees of future market performance.
The script does not place or manage orders. Users are responsible for their own analysis, trading decisions, position sizing, and risk management.
Past performance does not guarantee future results.
Release Note
SBP Trend Phase Navigator is a rule-based analytical indicator designed for short-horizon market analysis. Its objective is to identify one qualified bullish or bearish setup during each confirmed directional phase while preventing repeated same-direction signals until the market establishes a new phase. Rather than combining several unrelated indicators, the script follows one integrated analytical workflow where every calculation contributes to a single signal-generation process.The indicator evaluates trend direction, trend strength, momentum, candle quality, market structure, volatility, and confirmed swing context before issuing a BUY or SELL setup. Every signal must pass all qualification stages, helping filter low-quality opportunities during weak or unstable market conditions.
Methodology
The workflow begins by establishing market direction using a smoothed Trend Filter, a Hull-style Adaptive Trend average, and the relationship between fast and slow exponential moving averages. Trend strength is normalized using the Average True Range (ATR), allowing the indicator to adapt to changing market volatility rather than relying on fixed price movements.
After directional alignment is confirmed, the script evaluates several quality filters:
ATR-normalized momentum
Candle body strength and closing position
Break of prior market structure
Confirmed swing-pivot validation
Volatility filtering
Distance from the Adaptive Trend line
These measurements are combined into a normalized quality score. Depending on the selected Signal Quality profile, different minimum thresholds must be satisfied before a setup becomes eligible.
Phase Lock
A key feature of the indicator is its confirmed phase-lock mechanism. Consecutive bullish or bearish trend-qualified candles establish an active market phase. Once a BUY or SELL setup has been generated, another setup in the same direction cannot appear until the opposite directional phase has been confirmed.
This approach maintains a disciplined BUY → SELL → BUY → SELL sequence and helps eliminate repeated signals during the same market trend.
Swing Context
Confirmed swing highs and lows are used only as contextual validation and never generate independent trading signals.
For bullish setups, price must advance a minimum ATR-normalized distance from a recent confirmed swing low. For bearish setups, price must decline sufficiently from a confirmed swing high. Responsive, Balanced, and Conservative swing-context profiles adjust pivot sensitivity and confirmation requirements to suit different trading styles.
Trend Lines
The Adaptive Trend line is enabled by default and provides continuous visual feedback on short-term trend direction through automatic color changes based on slope. An optional Trend Filter offers an additional smoothed directional reference. Both trend lines can be customized using input settings for visibility, color, and width without affecting the underlying calculations.
Alerts and Confirmation
Primary BUY and SELL signals are evaluated only after the chart bar has closed, reducing false signals caused by intrabar price fluctuations. The indicator includes Bullish Setup, Bearish Setup, and Any Setup alerts, all based on the same final signal conditions displayed on the chart.
Important Notes
SBP Trend Phase Navigator is an analytical indicator, not a trading strategy. It does not execute trades, calculate position sizes, predict future prices, or guarantee profitable outcomes. Like all trend-following methods, performance depends on market conditions, symbol selection, timeframe, and proper risk management. The indicator is intended to assist analysis and should always be used alongside independent market evaluation and sound trading discipline.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
S B Prasad Trading Ecosystem Email sbptradingecosystem@gmail.com, Mobile no 9903367725
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
S B Prasad Trading Ecosystem Email sbptradingecosystem@gmail.com, Mobile no 9903367725
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน