OPEN-SOURCE SCRIPT
Transfer Function Filter [theUltimator5]

The Transfer Function Filter is an engineering style approach to transform the price action on a chart into a frequency, then filter out unwanted signals using Butterworth-style filter approach.
This indicator allows you to analyze market structure by isolating or removing different frequency components of price movement—similar to how engineers filter signals in control systems and electrical circuits.
🔎 Features
Four Filter Types
1) Low Pass Filter – Smooths price data, highlighting long-term trends while filtering out short-term noise. This filter acts similar to an EMA, removing noisy signals, resulting in a smooth curve that follows the price of the stock relative to the filter cutoff settings.
Real world application for low pass filter - Used in power supplies to provide a clean, stable power level.
2) High Pass Filter – Removes slow-moving trends to emphasize short-term volatility and rapid fluctuations. The high pass filter removes the "DC" level of the chart, removing the average price moves and only outputting volatility.
Real world application for high pass filter - Used in audio equalizers to remove low-frequency noise (like rumble) while allowing higher frequencies to pass through, improving sound clarity.
3) Band Pass Filter – Allows signals to plot only within a band of bar ranges. This filter removes the low pass "DC" level and the high pass "high frequency noise spikes" and shows a signal that is effectively a smoothed volatility curve. This acts like a moving average for volatility.
Real world application for band pass filter - Radio stations only allow certain frequency bands so you can change your radio channel by switching which frequency band your filter is set to.
4) Band Stop Filter – Suppresses specific frequency bands (cycles between two cutoffs). This filter allows through the base price moving average, but keeps the high frequency volatility spikes. It allows you to filter out specific time interval price action.
Real world application for band stop filter - If there is prominent frequency signal in the area which can cause unnecessary noise in your system, a band stop filter can cancel out just that frequency so you get everything else
Configurable Parameters
• Cutoff Periods – Define the cycle lengths (in bars) to filter. This is a bit counter-intuitive with the numbering since the higher the bar count on the low-pass filter, the lower the frequency cutoff is. The opposite holds true for the high pass filter.
• Filter Order – Adjust steepness and responsiveness (higher order = sharper filtering, but with more delay).
• Overlay Option – Display Low Pass & Band Stop outputs directly on the price chart, or in a separate pane. This is enabled by default, plotting the filters that mimic moving averages directly onto the chart.
• Source Selection – Apply filters to close, open, high, low, or custom sources.
Histograms for Comparison
• BS–LP Histogram – Shows distance between Band Stop and Low Pass filters.
• BP–HP Histogram – Highlights differences between Band Pass and High Pass filters.
Histograms give the visualization of a pseudo-MACD style indicator
Visual & Informational Aids
• Customizable colors for each filter line.
• Optional zero-line for histogram reference.
• On-chart info table summarizing active filters, cutoff settings, histograms, and filter order.
📊 Use Cases
Trend Detection – Use the Low Pass filter to smooth noise and follow underlying market direction.
Volatility & Cycle Analysis – Apply High Pass or Band Pass to capture shorter-term patterns.
Noise Suppression – Deploy Band Stop to remove specific choppy frequencies.
Momentum Insight – Watch the histograms to spot divergences and relative filter strength.
This indicator allows you to analyze market structure by isolating or removing different frequency components of price movement—similar to how engineers filter signals in control systems and electrical circuits.
🔎 Features
Four Filter Types
1) Low Pass Filter – Smooths price data, highlighting long-term trends while filtering out short-term noise. This filter acts similar to an EMA, removing noisy signals, resulting in a smooth curve that follows the price of the stock relative to the filter cutoff settings.
Real world application for low pass filter - Used in power supplies to provide a clean, stable power level.
2) High Pass Filter – Removes slow-moving trends to emphasize short-term volatility and rapid fluctuations. The high pass filter removes the "DC" level of the chart, removing the average price moves and only outputting volatility.
Real world application for high pass filter - Used in audio equalizers to remove low-frequency noise (like rumble) while allowing higher frequencies to pass through, improving sound clarity.
3) Band Pass Filter – Allows signals to plot only within a band of bar ranges. This filter removes the low pass "DC" level and the high pass "high frequency noise spikes" and shows a signal that is effectively a smoothed volatility curve. This acts like a moving average for volatility.
Real world application for band pass filter - Radio stations only allow certain frequency bands so you can change your radio channel by switching which frequency band your filter is set to.
4) Band Stop Filter – Suppresses specific frequency bands (cycles between two cutoffs). This filter allows through the base price moving average, but keeps the high frequency volatility spikes. It allows you to filter out specific time interval price action.
Real world application for band stop filter - If there is prominent frequency signal in the area which can cause unnecessary noise in your system, a band stop filter can cancel out just that frequency so you get everything else
Configurable Parameters
• Cutoff Periods – Define the cycle lengths (in bars) to filter. This is a bit counter-intuitive with the numbering since the higher the bar count on the low-pass filter, the lower the frequency cutoff is. The opposite holds true for the high pass filter.
• Filter Order – Adjust steepness and responsiveness (higher order = sharper filtering, but with more delay).
• Overlay Option – Display Low Pass & Band Stop outputs directly on the price chart, or in a separate pane. This is enabled by default, plotting the filters that mimic moving averages directly onto the chart.
• Source Selection – Apply filters to close, open, high, low, or custom sources.
Histograms for Comparison
• BS–LP Histogram – Shows distance between Band Stop and Low Pass filters.
• BP–HP Histogram – Highlights differences between Band Pass and High Pass filters.
Histograms give the visualization of a pseudo-MACD style indicator
Visual & Informational Aids
• Customizable colors for each filter line.
• Optional zero-line for histogram reference.
• On-chart info table summarizing active filters, cutoff settings, histograms, and filter order.
📊 Use Cases
Trend Detection – Use the Low Pass filter to smooth noise and follow underlying market direction.
Volatility & Cycle Analysis – Apply High Pass or Band Pass to capture shorter-term patterns.
Noise Suppression – Deploy Band Stop to remove specific choppy frequencies.
Momentum Insight – Watch the histograms to spot divergences and relative filter strength.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。