Class FixingHistory

java.lang.Object
com.quantfinlib.rates.FixingHistory

public final class FixingHistory extends Object
Published fixings of one index (for example SOFR), by fixing date. A seasoned trade needs them: a coupon whose fixings are already in the past is not forecast off a curve, it is computed from what was published.

Rule used by the legs: a fixing dated before the valuation date must be in the history (else the valuation throws, because silently forecasting a past fixing would misprice a seasoned trade); a fixing dated on the valuation date is taken from the history when present and forecast otherwise; later fixings are always forecast.

  • Method Details

    • empty

      public static FixingHistory empty()
      A history with no fixings (a forward-starting or unseasoned trade).
      Returns:
      the empty history
    • of

      public static FixingHistory of(Map<LocalDate, Double> fixings)
      A history from a date-to-rate map (decimal rates, finite). The map is copied.
      Parameters:
      fixings - fixing date to published rate
      Returns:
      the history
    • fixing

      public OptionalDouble fixing(LocalDate date)
      The fixing published for date, if any.
      Parameters:
      date - fixing date
      Returns:
      the fixing or empty
    • size

      public int size()
      Number of fixings held.
      Returns:
      the count