|
From: Ben W. <ben...@ma...> - 2023-08-21 00:32:37
|
You can build bonds from cashflows. I use it to price extendable bonds
def make_frb(self):
self.freq = ql.Period(qq.Frequency.get(self.tenor))
self.fixedDayCount=qq.DayCountBasis.get(self.paymentConvention)
self.bond_cashflows,self.reset_spread,self.reset_index=self.get_coupon_cashflows()
bond=ql.Bond(int(self.settlementDays), self.local_calendar, self.start_date,self.bond_cashflows)
self.accrual_start_date = ql.BondFunctions.accrualStartDate(bond)
return bond
self.start_date,self.bond_cashflows() is a internal function that returns the cashflows
From: Michael (DataDriven portal) <mi...@da...>
Sent: Saturday, August 19, 2023 8:05 PM
To: QuantLib users <qua...@li...>
Subject: [Quantlib-users] Bond With Custom Cashflows
Hi All,
I have a bond with a standard schedule but not standard cash flow dollar amounts that I can define (that doesn't fit any Quantlib standard bond types). Is it possible to create a bond object in Quantlib with these cashflows? For example, start with a fixed rate bond, and then overwrite the cashflow amounts. Or create it any other way?
Thanks!
Michael
|