Quantlib: Bond with both callable and puttable options

Viewed 133

I am trying to use quantlib to price a bond with both callable and puttable options. I have seen examples for pricing callable bonds using ql.CallabilitySchedule(). I would like to ask how to include dates and strike prices for both put and call options in ql.CallabilitySchedule().

Thanks.

1 Answers

As a disclaimer, I haven't tried this myself but if you look at example, where I am reposting below the relevant part:

putCallSchedule.append(
    ql.Callability(callability_price, ql.Callability.Call, ql.Date(15,6,2021))
)

The 2nd argument to the ql.Callability is the Type which can be either Call or Put. Therefore, try adding your Put days using ql.Callability.Put instead of ql.Callability.Call.

Related