Class InformationRatioRTIndicator

All Implemented Interfaces:
Resettable, RTIndicator

public class InformationRatioRTIndicator extends AbstractWindowSeriesRTIndicator
Rolling Information Ratio with O(1) per-tick updates.

Measures the risk-adjusted active return of an asset relative to a benchmark:

  IR = mean(activeReturn) / stddev(activeReturn)
where activeReturn = ln(asset/prevAsset) - ln(benchmark/prevBenchmark).

The Information Ratio quantifies how consistently an asset outperforms its benchmark. Higher IR means more consistent outperformance.

Maintains a single window storing active returns with dual accumulators (sumAR, sumARSq). The first tick pair establishes the initial prices.

Returns 0 when tracking error (stddev of active returns) is zero or window has fewer than 2 returns.

  • Constructor Details

    • InformationRatioRTIndicator

      public InformationRatioRTIndicator(int periods)
  • Method Details

    • onEvict

      protected void onEvict(double evicted)
      Description copied from class: AbstractWindowSeriesRTIndicator
      Called when the window evicts the oldest value. Override to update accumulators.
      Overrides:
      onEvict in class AbstractWindowSeriesRTIndicator
    • onReset

      protected void onReset()
      Description copied from class: AbstractWindowSeriesRTIndicator
      Called after window is cleared. Override to zero accumulators.
      Overrides:
      onReset in class AbstractWindowSeriesRTIndicator
    • withAnnualizationFactor

      public InformationRatioRTIndicator withAnnualizationFactor(double factor)
      Sets the annualization factor. The output is multiplied by this factor.
    • getMeanActiveReturn

      public double getMeanActiveReturn()
      Returns the current mean active return over the window.
    • getTrackingError

      public double getTrackingError()
      Returns the current tracking error (stddev of active returns).
    • update

      public double update(double newValue)
      Not supported — Information Ratio requires two inputs. Use update(double, double).
      Specified by:
      update in interface RTIndicator
      Overrides:
      update in class AbstractRTIndicator
      Throws:
      UnsupportedOperationException - always
    • update

      public double update(double asset, double benchmark)
      Updates the indicator with a new (asset, benchmark) price pair and returns the current Information Ratio.