Open-source

Trend Filter (2-pole)

Trend Filter (2-pole) The Trend Filter (2-pole) is an advanced trend-following indicator based on a two-pole filter, which smooths out market noise while effectively...

Trend Filter (2-pole) preview
Published Jan 17, 2025
4,92888,672

What this TradingView script does

Trend Filter (2-pole)

The Trend Filter (2-pole) is an advanced trend-following indicator based on a two-pole filter, which smooths out market noise while effectively highlighting trends and their strength. It incorporates color gradients and support/resistance dots to enhance trend visualization and decision-making for traders.

SP500:

🔵What is a Two-Pole Filter? A two-pole filter is a digital signal processing technique widely used in electronics, control systems, and time series data analysis to smooth data and reduce noise.

//@function Two-pole filter //@param src (series float) Source data (e.g., price) //@param length (float) Length of the filter (higher value means smoother output) //@param damping (float) Damping factor for the filter //@returns (series float) Filtered value method two_pole_filter(float src, int length, float damping) => // Calculate filter coefficients float omega = 2.0 * math.pi / length float alpha = damping * omega float beta = math.pow(omega, 2) // Initialize the filter variables var float f1 = na var float f2 = na

// Update the filter f1 := nz(f1) + alpha * (src - nz(f1)) f2 := nz(f2) + beta * (f1 - nz(f2)) f2

- It operates using two cascaded smoothing stages (poles), allowing for a more refined and responsive output compared to simple moving averages or other basic filters.

- Two-pole filters are particularly valued for their ability to maintain smooth transitions while reducing lag, making them ideal for applications where precision and responsiveness are critical.

- In trading, this filter helps detect trends by smoothing price data while preserving significant directional changes.

🔵Key Features of the Indicator:

How traders can use it

Use Trend Filter (2-pole) as a chart context layer inside TradingView: read the structure it highlights, compare it with your market bias, and let the script narrow which moves deserve attention.

The strongest workflow is to combine the script with higher timeframe structure, volume context, and a repeatable execution plan instead of treating any single label as a standalone trade.

Ready to level up your trading?

Get advanced indicators, backtesting and the BigBeluga community in one plan.

Get Access