Class FixAnalyzer

java.lang.Object
com.quantfinlib.regulatory.FixAnalyzer

public final class FixAnalyzer extends Object
WM/R-style 4pm fix analysis: computes a fix rate from samples inside the fixing window and screens a participant's flow for the classic "banging the close" signature — a large share of window volume, a price run-up aligned with the participant's net flow into the fix, and reversion afterwards.

The published WM/Refinitiv methodology (since February 2015) takes a five-minute window of one-second snapshots, computes the median of the bids and the median of the offers separately (trade-based where trades are available), and publishes the mid of the two medians. calculateFix(double[], double[]) implements that bid/offer construction on samples the caller provides; calculateFix(double[]) is the simpler median of mids. Neither reproduces the vendor's data capture, validation and trade/quote rules, so the result is a WM/R-style estimate, not the official benchmark.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    analyze(double[] midSamplesInWindow, double preWindowMid, double postWindowMid, long participantBuyQty, long participantSellQty, long marketVolume, double shareThreshold)
    Screens one participant's fixing-window activity.
    static double
    calculateFix(double[] midSamplesInWindow)
    Median of the mid samples captured inside the fixing window.
    static double
    calculateFix(double[] bidSamples, double[] offerSamples)
    WM/R-style fix: the mid of the separate medians of bid and offer snapshots in the window, (median(bids) + median(offers)) / 2.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • calculateFix

      public static double calculateFix(double[] midSamplesInWindow)
      Median of the mid samples captured inside the fixing window.
    • calculateFix

      public static double calculateFix(double[] bidSamples, double[] offerSamples)
      WM/R-style fix: the mid of the separate medians of bid and offer snapshots in the window, (median(bids) + median(offers)) / 2.
    • analyze

      public static FixAnalyzer.FixImpactReport analyze(double[] midSamplesInWindow, double preWindowMid, double postWindowMid, long participantBuyQty, long participantSellQty, long marketVolume, double shareThreshold)
      Screens one participant's fixing-window activity.

      Flags when all three hold: participation share ≥ threshold, the run-up into the fix is aligned with the participant's net flow, and the price reverts against that flow after the window (impact that decays is the footprint of pressure, not information).

      Parameters:
      midSamplesInWindow - mid samples inside the fixing window
      preWindowMid - mid just before the window opens
      postWindowMid - mid after the window closes
      participantBuyQty - participant buy volume in the window
      participantSellQty - participant sell volume in the window
      marketVolume - total market volume in the window
      shareThreshold - participation share that triggers scrutiny (e.g. 0.25)