OPEN-SOURCE SCRIPT
Kernel Filter Histogram (RBF)

The Kernel Filter Histogram (RBF) is a regime-detection and edge-confirmation tool built on Gaussian (RBF) kernel regression.
It is designed to identify when market conditions are favorable for participation and when traders should stay defensive.
Instead of reacting to price noise, this indicator measures the normalized slope of a smoothed kernel regression curve, converts it into a z-score, and displays it as a histogram representing directional edge pressure.
What It Measures
Underlying market regime (bullish, bearish, or neutral)
Strength and quality of directional momentum
Statistical edge expansion vs compression
When trend continuation is more likely vs chop
How It Works
Applies Nadaraya–Watson kernel regression using a Gaussian (RBF) kernel
Calculates the slope of the regression curve
Normalizes slope using ATR for cross-instrument consistency
Converts the result into a z-score to measure statistical deviation
Smooths the output into a readable histogram + signal line
Uses an optional threshold gate to filter low-quality conditions
Reading the Histogram
Green bars → Bullish regime / positive edge
Red bars → Bearish regime / negative edge
Gray bars → Neutral / low-edge environment
Above zero → Bullish pressure dominates
Below zero → Bearish pressure dominates
Threshold gating allows you to require minimum edge strength before treating signals as actionable.
Best Use Cases
Trade filter (only take longs when bullish, shorts when bearish)
Regime confirmation for existing strategies
Momentum quality assessment
Avoiding chop and low-probability setups
Multi-timeframe alignment tool
What This Is (and Is Not)
✔ IS: A high-quality regime and edge filter
✔ IS: Designed for professional trading systems
✔ IS: Instrument-agnostic and timeframe-agnostic
✖ NOT: A buy/sell signal generator
✖ NOT: A lagging moving average
✖ NOT: A beginner indicator
Recommended Usage
Use this indicator as a gatekeeper:
Only execute setups when the histogram confirms favorable regime conditions
Combine with your entry trigger, not instead of it
Works exceptionally well with trend-following, momentum, and mean-expansion systems
It is designed to identify when market conditions are favorable for participation and when traders should stay defensive.
Instead of reacting to price noise, this indicator measures the normalized slope of a smoothed kernel regression curve, converts it into a z-score, and displays it as a histogram representing directional edge pressure.
What It Measures
Underlying market regime (bullish, bearish, or neutral)
Strength and quality of directional momentum
Statistical edge expansion vs compression
When trend continuation is more likely vs chop
How It Works
Applies Nadaraya–Watson kernel regression using a Gaussian (RBF) kernel
Calculates the slope of the regression curve
Normalizes slope using ATR for cross-instrument consistency
Converts the result into a z-score to measure statistical deviation
Smooths the output into a readable histogram + signal line
Uses an optional threshold gate to filter low-quality conditions
Reading the Histogram
Green bars → Bullish regime / positive edge
Red bars → Bearish regime / negative edge
Gray bars → Neutral / low-edge environment
Above zero → Bullish pressure dominates
Below zero → Bearish pressure dominates
Threshold gating allows you to require minimum edge strength before treating signals as actionable.
Best Use Cases
Trade filter (only take longs when bullish, shorts when bearish)
Regime confirmation for existing strategies
Momentum quality assessment
Avoiding chop and low-probability setups
Multi-timeframe alignment tool
What This Is (and Is Not)
✔ IS: A high-quality regime and edge filter
✔ IS: Designed for professional trading systems
✔ IS: Instrument-agnostic and timeframe-agnostic
✖ NOT: A buy/sell signal generator
✖ NOT: A lagging moving average
✖ NOT: A beginner indicator
Recommended Usage
Use this indicator as a gatekeeper:
Only execute setups when the histogram confirms favorable regime conditions
Combine with your entry trigger, not instead of it
Works exceptionally well with trend-following, momentum, and mean-expansion systems
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.