1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Missing Fixing when pricing a CAP Quantlib Python

Discussão em 'Python' iniciado por Stack, Março 10, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to price a Cap with Quantlib in Python. I have the following lists given:

    • dates_3M starting at ql.Date(25,11,2019)
    • rates_3M
    • dates_ois starting at ql.Date(25,11,2019)
    • rates_ois

    My code so far looks like this:

    ref_date = ql.Date(25,11,2019)

    calendar = ql.TARGET()
    curve_ois = ql.ZeroCurve(dates_ois, rates_ois, ql.Actual360(), calendar, ql.Linear(), ql.Compounded, ql.Annual)
    curve_ois_handle = ql.YieldTermStructureHandle(curve_ois)
    curve_3M = ql.ZeroCurve(dates_3M, rates_3M, ql.Actual360(), calendar, ql.Linear(), ql.Compounded, ql.Annual)
    curve_3M_handle = ql.YieldTermStructureHandle(curve_3M)

    startDate = ref_date + 2
    endDate = calendar.advance(ref_date, ql.Period('72M')
    schedule = ql.Schedule(startDate, endDate, ql.Period(ql.Quarterly), calendar, ql.ModifiedFollowing, ql.ModifiedFollowing, ql.DateGeneration.Forward, False)
    nom = 1000000
    capRate = 0.03

    cap = ql.Cap(ql.IborLeg([nominal], schedule, ql.Euribor3M(curve_3M_handle)), [capRate])

    engine = ql.BachelierCapFloorEngine(curve_ois_handle, ql.QuoteHandle(ql.SimpleQuote(0.3439))
    cap.setPricingEngine(engine)
    print(cap.NPV())


    I get the error: "Missing Euribor3M Actual/360 fixing for February 25th, 2025."

    My Euribor Curve starts with the reference date 25.11.2025 and goes until 27.11.2079. In the beginning I have a data point every month but from 2022 only once a year. I got 28.11.2022, 27.11.2023, 27.11.2024, 27.11.2025, ... The cap I am trying to price starts at reference_date + 2 days and goes for 72 Months. So it should end in November 2025. However, the missing fixing is in February 2025.

    Continue reading...

Compartilhe esta Página