OPEN-SOURCE SCRIPT
Cập nhật Median TR SuperTrend | RakoQuant

Median TR SuperTrend | RakoQuant
A Robust Trend-Following Regime Indicator for Daily Crypto Markets
The Median TR SuperTrend is a modern trend-following indicator designed to help students and traders clearly identify the dominant market regime on higher timeframes (especially 1D crypto).
This tool is inspired by the classic SuperTrend framework, but enhanced with a more robust volatility engine, making it better suited for the extreme wick behavior and noise typical in cryptocurrency markets.
What This Indicator Does:
The Median TR SuperTrend answers one simple question:
Are we currently in a bullish trend regime or a bearish trend regime?
It is not meant for rapid scalping or frequent signals.
Instead, it is built to provide:
Clear directional context
Trend continuation bias
Regime-based positioning
Noise reduction on higher timeframes
This makes it ideal for students learning disciplined trend-following.
Core Concept: Trend Following, Not Prediction
This indicator does not attempt to predict tops or bottoms.
It follows trends by reacting only when price establishes a true breakout beyond a volatility-adjusted band.
That means:
Strong trends are captured early
Choppy markets are filtered
Signals are based on regime shifts, not candle-to-candle noise
What Makes It “Robust”?
Traditional SuperTrend systems use ATR (Average True Range) to define volatility.
Crypto markets, however, often produce outlier candles (wicks, liquidations, spikes) that distort ATR.
This version replaces ATR with:
Median True Range (MTR)
Median TR is more resistant to extreme one-off candles, providing:
Smoother volatility estimates
More stable trend bands
Less sensitivity to random spikes
This creates a more reliable trend structure in high-volatility environments.
How It Works (Simple Breakdown)
1. Median Baseline
The indicator begins by calculating a rolling median of price, forming a stable central trend reference.
2. Robust Volatility Bands
A volatility envelope is created using Median True Range:
Upper band = baseline + multiplier × MTR
Lower band = baseline − multiplier × MTR
3. SuperTrend Regime Logic
Only one band is active at a time:
Bull regime → trailing lower band
Bear regime → trailing upper band
Trend flips occur only when price breaks beyond the active band.
Visual Interpretation
Neon Aqua Band
Bullish regime
Trend-following long environment
Neon Magenta Band
Bearish regime
Defensive or short environment
Filled Trend Zone
Shows the active trend space clearly without clutter.
This indicator is designed for learning:
Market structure
Regime trading
Patience and higher timeframe discipline
Recommended workflow:
Use Median TR SuperTrend on 1D
Trade only in the direction of the active regime
Combine with a trigger tool if needed (RSI, momentum, breakout)
Ideal Markets
BTC, ETH, SOL
Daily swing trend environments
Portfolio regime filtering (RSPS / LTPI-style frameworks)
Disclaimer
This indicator is a regime and trend-following tool, not a complete trading system.
It should be used as part of a broader strategy with:
Risk management
Position sizing
Confirmation logic
A Robust Trend-Following Regime Indicator for Daily Crypto Markets
The Median TR SuperTrend is a modern trend-following indicator designed to help students and traders clearly identify the dominant market regime on higher timeframes (especially 1D crypto).
This tool is inspired by the classic SuperTrend framework, but enhanced with a more robust volatility engine, making it better suited for the extreme wick behavior and noise typical in cryptocurrency markets.
What This Indicator Does:
The Median TR SuperTrend answers one simple question:
Are we currently in a bullish trend regime or a bearish trend regime?
It is not meant for rapid scalping or frequent signals.
Instead, it is built to provide:
Clear directional context
Trend continuation bias
Regime-based positioning
Noise reduction on higher timeframes
This makes it ideal for students learning disciplined trend-following.
Core Concept: Trend Following, Not Prediction
This indicator does not attempt to predict tops or bottoms.
It follows trends by reacting only when price establishes a true breakout beyond a volatility-adjusted band.
That means:
Strong trends are captured early
Choppy markets are filtered
Signals are based on regime shifts, not candle-to-candle noise
What Makes It “Robust”?
Traditional SuperTrend systems use ATR (Average True Range) to define volatility.
Crypto markets, however, often produce outlier candles (wicks, liquidations, spikes) that distort ATR.
This version replaces ATR with:
Median True Range (MTR)
Median TR is more resistant to extreme one-off candles, providing:
Smoother volatility estimates
More stable trend bands
Less sensitivity to random spikes
This creates a more reliable trend structure in high-volatility environments.
How It Works (Simple Breakdown)
1. Median Baseline
The indicator begins by calculating a rolling median of price, forming a stable central trend reference.
2. Robust Volatility Bands
A volatility envelope is created using Median True Range:
Upper band = baseline + multiplier × MTR
Lower band = baseline − multiplier × MTR
3. SuperTrend Regime Logic
Only one band is active at a time:
Bull regime → trailing lower band
Bear regime → trailing upper band
Trend flips occur only when price breaks beyond the active band.
Visual Interpretation
Neon Aqua Band
Bullish regime
Trend-following long environment
Neon Magenta Band
Bearish regime
Defensive or short environment
Filled Trend Zone
Shows the active trend space clearly without clutter.
This indicator is designed for learning:
Market structure
Regime trading
Patience and higher timeframe discipline
Recommended workflow:
Use Median TR SuperTrend on 1D
Trade only in the direction of the active regime
Combine with a trigger tool if needed (RSI, momentum, breakout)
Ideal Markets
BTC, ETH, SOL
Daily swing trend environments
Portfolio regime filtering (RSPS / LTPI-style frameworks)
Disclaimer
This indicator is a regime and trend-following tool, not a complete trading system.
It should be used as part of a broader strategy with:
Risk management
Position sizing
Confirmation logic
Phát hành các Ghi chú
### BTC 1D Example
Aqua = Bull Regime
Magenta = Bear Regime
Designed as a Daily trend-following regime filter for crypto markets.
Phát hành các Ghi chú
Update: Intraday Mode AddedAdded optional Intraday preset (30m–4H)
Includes smoothing filter to reduce chop
Daily/Swing behavior remains unchanged
Users can switch modes in the settings panel
Phát hành các Ghi chú
V3Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.