What this TradingView script does
The Two-Pole Oscillator is an advanced smoothing oscillator designed to provide traders with precise market signals by leveraging deviation-based calculations combined with a unique two-pole filtering technique. It offers clear visual representation and actionable signals for smart trading decisions.
🔵Key Features:
- Two-Pole Filtering: Smooths out the main oscillator signal to reduce noise, providing a cleaner and more reliable view of market momentum and trend strength.
// Two-pole smooth filter function f_two_pole_filter(source, length) => var float smooth1 = na var float smooth2 = na alpha = 2.0 / (length + 1)
if na(smooth1) smooth1 := source else smooth1 := (1 - alpha) * smooth1 + alpha * source
if na(smooth2) smooth2 := smooth1 else smooth2 := (1 - alpha) * smooth2 + alpha * smooth1
- Deviation-Based Oscillator: Utilizes price deviations from the mean to generate dynamic signals, making it ideal for detecting overbought and oversold conditions.
float sma1 = ta.sma(close, 25) float sma_n1 = ((close - sma1) - ta.sma(close - sma1, 25)) / ta.stdev(close - sma1, 25)
- Signal Gradient Strength: Signals on the main oscillator line feature gradient coloring based on their proximity to the 0 level: ➔ Closer to 0: More transparent, indicating weaker signals. ➔ Closer to 1 or -1: Less transparent, highlighting stronger signals.
- Level-Based Signal Validation: Parallel levels are plotted on the chart for each signal: ➔ If a level is crossed by price, the signal is invalidated, marked by an "X" at the invalidation point.
How traders can use it
Use Two-Pole Oscillator 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.




