OPEN-SOURCE SCRIPT
True Baseline Median SuperTrend

True Baseline Median SuperTrend (TBM SuperTrend) | MisinkoMaster
True Baseline Median SuperTrend is a volatility-adaptive trend indicator designed to refine traditional SuperTrend logic by introducing a volatility-filtered baseline and median-based smoothing techniques.
Instead of relying on a fixed midpoint calculation, TBM SuperTrend dynamically constructs its baseline from structurally significant price observations, then applies layered median smoothing to reduce noise while preserving trend integrity.
The result is a cleaner, more stable trend-following tool that reacts to meaningful shifts in volatility and directional pressure without excessive whipsaws.
Core Philosophy
Most SuperTrend-style indicators anchor their bands to a simple price midpoint and apply an ATR-based offset. While effective, this approach can be overly sensitive during volatile consolidations.
TBM SuperTrend improves this structure by:
• Building a volatility-qualified baseline
• Filtering insignificant price movements
• Applying median smoothing instead of simple averaging
• Retaining ATR-based adaptive band distance
This creates a trend structure that prioritizes meaningful price expansion over random noise.
Key Features
Volatility-qualified baseline construction
Median-smoothed upper and lower bands
ATR-based adaptive volatility envelope
Dynamic trend state detection
Automatic candle coloring
Clear long and short transition labels
Reduced whipsaw behavior compared to standard SuperTrend
Works across intraday and higher timeframes
Designed for trend continuation and breakout frameworks
How It Works (Conceptual)
The indicator operates in three structural layers:
Volatility Measurement
Market volatility is assessed using an ATR-based structure.
Baseline Construction
Instead of averaging all recent prices, the script filters price samples based on volatility conditions. Only structurally relevant bars contribute to the baseline calculation. This ensures that the baseline reflects meaningful movement rather than passive drift.
Median Smoothing
Both the volatility-adjusted bands and the baseline structure undergo median smoothing. Median smoothing is less sensitive to outliers than standard averaging, which helps stabilize the trend line during erratic price spikes.
After the adaptive bands are constructed, price interaction with those bands determines directional bias:
• Price closing above the upper threshold confirms bullish trend state
• Price closing below the lower threshold confirms bearish trend state
Internal implementation details remain proprietary in the protected version.
Trend Logic Explained
Bullish State
When price maintains strength above the adaptive upper boundary, the indicator confirms a long bias. The trailing structure shifts beneath price, acting as dynamic support.
Bearish State
When price closes below the adaptive lower boundary, the indicator confirms a short bias. The trailing structure shifts above price, acting as dynamic resistance.
State transitions occur only when decisive boundary breaks happen, helping reduce false flips.
Visual Components
Trend Lines
Only the active directional band is displayed, reducing clutter and emphasizing current bias.
Shaded Volatility Zone
A filled region between price and the active band visually highlights trend dominance.
Long / Short Labels
Clear on-chart labels mark confirmed trend transitions.
Candle Coloring
Price candles automatically reflect current trend state for immediate visual recognition.
Inputs Overview
Source
Defines the price series used for baseline construction.
ATR Length
Controls the volatility lookback period.
True Baseline Length
Determines the window used for constructing the volatility-qualified baseline.
Factor
Adjusts the volatility multiplier that expands or contracts the adaptive bands.
Median Period
Controls the median smoothing strength applied to the bands.
Lower values increase responsiveness.
Higher values improve stability and reduce noise.
Why Median Smoothing Matters
Traditional smoothing methods (like EMA or SMA) can be distorted by sharp price spikes. Median-based smoothing reduces the impact of extreme values, making TBM SuperTrend particularly effective in:
• Crypto markets
• High-volatility equities
• News-driven instruments
• Lower timeframe trading
This improves structural consistency during sudden volatility expansions.
Best Use Cases
Trend-following systems
Breakout confirmation
Pullback entries within established trends
Trailing stop framework
Directional bias filtering
Volatility-adaptive strategy design
Parameter Tuning Guidance
Shorter ATR Length
→ Faster adaptation
→ More sensitivity
→ Suitable for intraday trading
Longer ATR Length
→ Smoother volatility structure
→ Better for swing trading
Higher Factor
→ Wider bands
→ Fewer signals
→ Stronger trend confirmation
Lower Factor
→ Tighter bands
→ Earlier entries
→ More reversals
Longer Median Period
→ Smoother band structure
→ Reduced whipsaws
Shorter Median Period
→ Faster reaction
→ More sensitivity to shifts
Practical Strategy Integration
Use TBM SuperTrend as:
• Primary directional filter
• Trailing stop mechanism
• Confirmation layer for breakout systems
• Bias alignment tool across multiple timeframes
It performs best when combined with momentum confirmation or volume expansion tools.
Summary
True Baseline Median SuperTrend enhances traditional SuperTrend logic by introducing volatility-qualified baseline construction and median smoothing for structural stability.
The result is a cleaner, more adaptive trend tool that prioritizes meaningful price movement while minimizing noise. It is well suited for traders seeking a disciplined, volatility-aware trend framework that remains robust across changing market conditions.
True Baseline Median SuperTrend is a volatility-adaptive trend indicator designed to refine traditional SuperTrend logic by introducing a volatility-filtered baseline and median-based smoothing techniques.
Instead of relying on a fixed midpoint calculation, TBM SuperTrend dynamically constructs its baseline from structurally significant price observations, then applies layered median smoothing to reduce noise while preserving trend integrity.
The result is a cleaner, more stable trend-following tool that reacts to meaningful shifts in volatility and directional pressure without excessive whipsaws.
Core Philosophy
Most SuperTrend-style indicators anchor their bands to a simple price midpoint and apply an ATR-based offset. While effective, this approach can be overly sensitive during volatile consolidations.
TBM SuperTrend improves this structure by:
• Building a volatility-qualified baseline
• Filtering insignificant price movements
• Applying median smoothing instead of simple averaging
• Retaining ATR-based adaptive band distance
This creates a trend structure that prioritizes meaningful price expansion over random noise.
Key Features
Volatility-qualified baseline construction
Median-smoothed upper and lower bands
ATR-based adaptive volatility envelope
Dynamic trend state detection
Automatic candle coloring
Clear long and short transition labels
Reduced whipsaw behavior compared to standard SuperTrend
Works across intraday and higher timeframes
Designed for trend continuation and breakout frameworks
How It Works (Conceptual)
The indicator operates in three structural layers:
Volatility Measurement
Market volatility is assessed using an ATR-based structure.
Baseline Construction
Instead of averaging all recent prices, the script filters price samples based on volatility conditions. Only structurally relevant bars contribute to the baseline calculation. This ensures that the baseline reflects meaningful movement rather than passive drift.
Median Smoothing
Both the volatility-adjusted bands and the baseline structure undergo median smoothing. Median smoothing is less sensitive to outliers than standard averaging, which helps stabilize the trend line during erratic price spikes.
After the adaptive bands are constructed, price interaction with those bands determines directional bias:
• Price closing above the upper threshold confirms bullish trend state
• Price closing below the lower threshold confirms bearish trend state
Internal implementation details remain proprietary in the protected version.
Trend Logic Explained
Bullish State
When price maintains strength above the adaptive upper boundary, the indicator confirms a long bias. The trailing structure shifts beneath price, acting as dynamic support.
Bearish State
When price closes below the adaptive lower boundary, the indicator confirms a short bias. The trailing structure shifts above price, acting as dynamic resistance.
State transitions occur only when decisive boundary breaks happen, helping reduce false flips.
Visual Components
Trend Lines
Only the active directional band is displayed, reducing clutter and emphasizing current bias.
Shaded Volatility Zone
A filled region between price and the active band visually highlights trend dominance.
Long / Short Labels
Clear on-chart labels mark confirmed trend transitions.
Candle Coloring
Price candles automatically reflect current trend state for immediate visual recognition.
Inputs Overview
Source
Defines the price series used for baseline construction.
ATR Length
Controls the volatility lookback period.
True Baseline Length
Determines the window used for constructing the volatility-qualified baseline.
Factor
Adjusts the volatility multiplier that expands or contracts the adaptive bands.
Median Period
Controls the median smoothing strength applied to the bands.
Lower values increase responsiveness.
Higher values improve stability and reduce noise.
Why Median Smoothing Matters
Traditional smoothing methods (like EMA or SMA) can be distorted by sharp price spikes. Median-based smoothing reduces the impact of extreme values, making TBM SuperTrend particularly effective in:
• Crypto markets
• High-volatility equities
• News-driven instruments
• Lower timeframe trading
This improves structural consistency during sudden volatility expansions.
Best Use Cases
Trend-following systems
Breakout confirmation
Pullback entries within established trends
Trailing stop framework
Directional bias filtering
Volatility-adaptive strategy design
Parameter Tuning Guidance
Shorter ATR Length
→ Faster adaptation
→ More sensitivity
→ Suitable for intraday trading
Longer ATR Length
→ Smoother volatility structure
→ Better for swing trading
Higher Factor
→ Wider bands
→ Fewer signals
→ Stronger trend confirmation
Lower Factor
→ Tighter bands
→ Earlier entries
→ More reversals
Longer Median Period
→ Smoother band structure
→ Reduced whipsaws
Shorter Median Period
→ Faster reaction
→ More sensitivity to shifts
Practical Strategy Integration
Use TBM SuperTrend as:
• Primary directional filter
• Trailing stop mechanism
• Confirmation layer for breakout systems
• Bias alignment tool across multiple timeframes
It performs best when combined with momentum confirmation or volume expansion tools.
Summary
True Baseline Median SuperTrend enhances traditional SuperTrend logic by introducing volatility-qualified baseline construction and median smoothing for structural stability.
The result is a cleaner, more adaptive trend tool that prioritizes meaningful price movement while minimizing noise. It is well suited for traders seeking a disciplined, volatility-aware trend framework that remains robust across changing market conditions.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
"Better to take a step back, than to stand stuck forever."
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
"Better to take a step back, than to stand stuck forever."
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.