All indicators

Isotonic Regression Oscillator

By LuxAlgoFeb 16, 2026

Static chart image
Oscillators

The Isotonic Regression Oscillator is an advanced trend strength indicator designed to measure the structural direction and complexity of price action using isotonic regression. By comparing non-decreasing and non-increasing regression fits calculated with the Pool Adjacent Violators Algorithm (PAVA), this trading indicator transforms price structure into a normalized oscillator between -100 and 100. The result is a powerful tool for identifying dominant trend bias, detecting structural shifts, and quantifying how “step-like” or persistent a market move truly is.

Note: The isotonic regression fit displayed on the price chart is subject to repainting and is shown retrospectively to reflect the most recent calculation window.

How to Trade the Isotonic Regression Oscillator?

This trading strategy tool combines two components:

  • A normalized oscillator ranging from -100 to 100
  • A visual isotonic regression fit line plotted directly on price

Together, they provide both directional bias and structural context for market analysis.

Understanding the Oscillator Signals

The oscillator compares two competing monotonic models:

  • A non-decreasing (bullish) regression fit
  • A non-increasing (bearish) regression fit

Whichever model produces the lower Mean Squared Error (MSE) becomes the dominant structural interpretation.

Positive Values (Bullish Bias)

  • The non-decreasing fit has a lower MSE than the bearish fit.
  • Price is better explained by a structured upward progression.
  • Higher positive values suggest a multi-step bullish structure with increasing complexity.

This is particularly useful for confirming bullish trend continuation strategies or filtering long entries in trending markets.

Negative Values (Bearish Bias)

  • The non-increasing fit has a lower MSE.
  • Price structure is better explained by a downward monotonic sequence.
  • Larger negative values reflect a more structured bearish move.

Traders can use this as confirmation for short setups or as a trend filter for systematic trading strategies.

Zero Crosses (Trend Bias Shift)

When the oscillator crosses above or below zero:

  • The dominant regression model changes.
  • Market structure shifts from bullish to bearish (or vice versa).
  • This can act as an early signal of a potential regime change.

Unlike simple moving average crossovers, this signal is based on structural fit rather than smoothing lag.

Measuring Trend Complexity with Fit Pools

One of the most unique aspects of this trading indicator is that it doesn’t just measure direction — it measures structural complexity.

The oscillator magnitude is based on the number of “pools” (constant segments) formed during the PAVA process:

  • Values near ±100 → Highly granular, step-like trend structure.
  • Values near 0 → Simple, flat, or nearly linear monotonic structure.

In practical terms:

  • High absolute readings indicate strong structural persistence.
  • Low readings indicate weak structure or transitional price behavior.

This makes the indicator especially powerful for distinguishing between:

  • Clean trends
  • Choppy consolidations
  • Structural breakouts

Technical Breakdown of the Indicator

The Pool Adjacent Violators Algorithm (PAVA)

Isotonic regression forces a sequence to be either:

  • Non-decreasing (bullish fit), or
  • Non-increasing (bearish fit)

The script implements the Pool Adjacent Violators Algorithm (PAVA), which works as follows:

  1. Scan through price data in the selected lookback window.
  2. If two adjacent values violate the monotonic constraint:
    • They are pooled together.
    • Their average replaces both values.
  3. The process repeats until the entire sequence satisfies the constraint.

This produces the closest monotonic sequence to the original data.

Compared to moving averages or polynomial regression, isotonic regression adapts to step-like price behavior without assuming smooth curvature.

MSE-Based Model Selection

For every bar:

  • A non-decreasing regression is calculated.
  • A non-increasing regression is calculated.
  • The Mean Squared Error (MSE) of both fits is computed.

The model with the lower MSE is selected as the dominant structural interpretation.

This objective selection mechanism removes directional bias and allows the trading indicator to adapt dynamically to current market structure.

Normalized Complexity Formula

The oscillator is normalized using:

((Number of Pools - 1) / (Period - 1)) * 100

This formula converts structural complexity into a standardized scale between:

  • 0 to +100 for bullish fits
  • 0 to -100 for bearish fits

The normalization ensures consistency across different timeframes and assets, making it suitable for:

  • Forex trading
  • Crypto trading
  • Stock market analysis
  • Futures and indices

Trading Strategy Applications

The Isotonic Regression Oscillator can be used in multiple ways:

  • Trend Filter: Only take long trades when oscillator > 0 and short trades when < 0.
  • Strength Confirmation: Look for extreme readings to confirm strong directional momentum.
  • Regime Detection: Use zero-line crossovers to identify structural trend shifts.
  • Structure Analysis: Compare oscillator magnitude across timeframes to detect multi-timeframe alignment.

Because it measures structural complexity rather than volatility or simple momentum, it pairs well with:

  • Breakout strategies
  • Market structure trading systems
  • Price action confirmation tools
  • Volatility-based risk management

SETTINGS

The indicator is designed to remain flexible across different trading styles and markets.

  • Period: Defines the lookback window used to compute isotonic regression fits.

    • Shorter periods → More reactive signals
    • Longer periods → More stable structural readings
  • Source: The price series used for calculations (default: Close).

Style Customization

  • Bullish Color: Applied when the bullish fit dominates.
  • Bearish Color: Applied when the bearish fit dominates.
  • Fit Line Width: Controls regression line thickness.
  • Fit Line Style: Choose between Solid, Dashed, or Dotted visualization.

These styling options allow traders to integrate the indicator seamlessly into existing chart templates.

Frequently Asked Questions (FAQ)

What makes the Isotonic Regression Oscillator different from traditional trend indicators?

Unlike moving averages or momentum oscillators, this trading indicator evaluates structural monotonic fits using isotonic regression. It measures how well price conforms to a non-decreasing or non-increasing model, providing a deeper view of trend persistence and complexity.

Does the regression fit repaint?

Yes. The visual isotonic regression line is calculated over a rolling lookback window and is displayed retrospectively. However, the oscillator values themselves are computed consistently for each bar.

Is this suitable for all markets?

Yes. The normalization process allows the oscillator to be used across stocks, crypto, forex, and futures markets on multiple timeframes.

How do I access the Isotonic Regression Oscillator?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.