OPEN-SOURCE SCRIPT

Filtered Percentile Oscillator

88
Filtered Percentile Oscillator (FPO | MisinkoMaster)

The Filtered Percentile Oscillator is a modern trend-following tool designed to combine the power of percentile ranking with adaptive trend strength filtering. By integrating a filter based on ADX strength, this oscillator aims to reduce noise and improve signal quality, helping traders identify more reliable bullish and bearish momentum zones.

This indicator works well across different markets, especially where volatility and trend clarity fluctuate. Although it can be noisy at times, the intelligent filtering mechanism provides strong potential for spotting actionable trend signals.

🔍 Concept & Idea

The idea behind the Filtered Percentile Oscillator is to use the percentile rank of price changes as a normalized measure of momentum, then apply an adaptive filter based on the Average Directional Index (ADX) to adjust sensitivity dynamically.

By combining these two concepts:

The Percentile Oscillator captures how extreme the current price is relative to recent price history.

The ADX-based filter adjusts threshold levels and confirms if the market is trending strongly enough to trust these percentile signals.

This dual-filtering mechanism improves the indicator’s ability to avoid false signals caused by noisy or non-trending environments.

⚙️ How It Works

The indicator calculates the Percentile Rank of the user-selected price source over a defined length (len). This percentile oscillator oscillates between -100% and +100%, reflecting relative price positioning.

It calculates the ADX and its percentile rank over a separate filter length (adx_len and ap_len) to estimate trend strength and market activity.

A combined potential filter checks if the sum of the absolute percentile oscillator and ADX percentile exceeds a user-defined threshold (pot_t). This filter controls whether signals are considered valid.

Thresholds for long and short signals dynamically adapt based on whether the ADX percentile exceeds the filter threshold (adx_t):

When strong trend strength is detected (ADX percentile > threshold), tighter upper and lower thresholds (ut and lt) apply to capture sharper trend signals.

When trend strength is weaker, wider thresholds (utm and ltm) are used to filter noise and reduce false signals.

Trend states are determined by comparing the percentile oscillator to these adaptive thresholds and validating the potential filter condition.

Overbought and oversold zones are also plotted for identifying potential reversal or exhaustion areas.

🧩 Inputs Overview

Length – Controls the lookback period for the Percentile Oscillator calculation (default 29).

Source – The price data source used for oscillator calculation (default: close).

Filter Length – Lookback period for ADX calculation used as a filter (default 12).

Filter % Length – Length used to calculate the percentile rank of the ADX filter (default 8).

Trending Upper Threshold – Upper bound for bullish signals when trend strength is strong (default 10).

Trending Lower Threshold – Lower bound for bearish signals when trend strength is strong (default -10).

Ranging Upper Threshold – Upper bound for bullish signals when trend strength is weak (default 15).

Ranging Lower Threshold – Lower bound for bearish signals when trend strength is weak (default -15).

Sum Filter Threshold – Minimum combined percentile value required to validate signals (default 100).

Filter Threshold – Minimum ADX percentile value required to switch to tighter thresholds (default 50).

Overbought – Level indicating overbought conditions for the oscillator (default 80).

Oversold – Level indicating oversold conditions for the oscillator (default -80).

📌 Usage Notes

Adaptive Filtering: The indicator dynamically adjusts sensitivity to market trend strength, reducing false signals during ranging or low-activity periods.

Normalized Momentum: Using percentile ranks allows comparison across different instruments and timeframes on a consistent scale.

Trend Confirmation: The ADX percentile filter ensures signals are stronger and more reliable when the market is trending.

Visual Guidance: Colored plots, threshold lines, and background fills improve signal interpretation and decision-making.

Customization: Thresholds and lengths can be fine-tuned for different markets or trading styles.

Complementary Use: Best combined with volume analysis, price action, or other indicators for comprehensive trade confirmation.

Backtest First: Always validate settings on historical data to match your preferred instrument and timeframe before live trading.

⚠️ Disclaimer

This indicator is provided solely for educational and analytical use. It is not financial advice. Trading involves risk, and users should perform their own due diligence before making trading decisions.

Enjoy improved trend filtering with the Filtered Percentile Oscillator!

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.