Forecast Oscillator (FOSC)

Parameters: period = 14 (5–50)

Overview

The Forecast Oscillator (FOSC) is a momentum indicator that measures how closely the price is tracking a linear regression forecast. Unlike traditional oscillators that use fixed thresholds, FOSC employs linear regression to create a dynamic forecast based on recent price trends. It calculates the percentage difference between the actual closing price and the Time Series Forecast value (the endpoint of a linear regression line), providing insights into whether prices are deviating from their expected trajectory.

The FOSC is particularly valuable because it combines the objectivity of statistical analysis with practical trading applications. When the price equals the forecast, the oscillator reads zero. Positive values indicate the price is above the forecasted value (potentially overbought or in an uptrend), while negative values suggest the price is below forecast (potentially oversold or in a downtrend). This self-adjusting nature makes FOSC effective in both trending and ranging markets, as the linear regression baseline automatically adapts to current market conditions.

Interpretation & Trading Signals

Oscillator Readings:

  • FOSC > 0: Price above forecast - potential uptrend or overbought
  • FOSC < 0: Price below forecast - potential downtrend or oversold
  • FOSC = 0: Price matches forecast - equilibrium point
  • Extreme Values: Larger deviations signal stronger overbought/oversold conditions

Trading Signals:

  • Zero-Line Cross Above: Bullish signal - price breaking above forecast
  • Zero-Line Cross Below: Bearish signal - price falling below forecast
  • Trend Reversals: Look for extremes followed by direction changes
  • Signal Line Crossovers: FOSC crossing its signal line provides entry/exit points

Best Practices:

  • Period Selection: Shorter periods = more sensitive, longer periods = smoother signals
  • Confirmation Required: Use with volume, price patterns, or other momentum indicators
  • Market Context: Most effective in trending markets where linear regression is meaningful
  • TSF Underestimate: Positive FOSC suggests Time Series Forecast has underestimated price

Example Usage

Code examples will be available once the Rust implementation is complete.

Performance Analysis

Related Indicators