Closed qiubill closed 2 months ago
Hi lballabio,
Last time I was asking the replacement code for
self.bond = ql.FixedRateBond(int(self.settlement_days), self.face_value, self.schedule, [ql.InterestRate(self.coupon, self.day_count, self.compounding_scheme, self.compounding_frequency)], self.business_day_convention)
Thanks for the quick answer that you offered me the replacement in release 1.34 as below:
coupons = ql.FixedRateLeg( self.schedule, self.day_count, [self.face_value], interestRates=[ql.InterestRate(self.coupon, self.day_count, self.compounding_scheme, self.compounding_frequency)], paymentAdjustment=self.business_day_convention, )
self.bond = ql.Bond( int(self.settlement_days), self.schedule.calendar(), self.schedule.startDate(), coupons, )
I tried it, which works very well. But in our existing code, we have another place to use the same constructor with an additional redemption_value parameter, such as:
self.bond = ql.FixedRateBond(int(self.settlement_days), self.face_value, self.schedule, [ql.InterestRate(self.coupon, self.day_count, self.compounding_scheme, self.compounding_frequency)], self.business_day_convention, self.redemption_value)
what will be the replacement in release 1.34? I didn't see the ql.Bond constructor that takes redemption value, was that changed to something else?
Thanks a lot and look forward to your reply!
Answered in #1945.
Hi lballabio,
Last time I was asking the replacement code for
self.bond = ql.FixedRateBond(int(self.settlement_days), self.face_value, self.schedule, [ql.InterestRate(self.coupon, self.day_count, self.compounding_scheme, self.compounding_frequency)], self.business_day_convention)
Thanks for the quick answer that you offered me the replacement in release 1.34 as below:
coupons = ql.FixedRateLeg( self.schedule, self.day_count, [self.face_value], interestRates=[ql.InterestRate(self.coupon, self.day_count, self.compounding_scheme, self.compounding_frequency)], paymentAdjustment=self.business_day_convention, )
self.bond = ql.Bond( int(self.settlement_days), self.schedule.calendar(), self.schedule.startDate(), coupons, )
I tried it, which works very well. But in our existing code, we have another place to use the same constructor with an additional redemption_value parameter, such as:
self.bond = ql.FixedRateBond(int(self.settlement_days), self.face_value, self.schedule, [ql.InterestRate(self.coupon, self.day_count, self.compounding_scheme, self.compounding_frequency)], self.business_day_convention, self.redemption_value)
what will be the replacement in release 1.34? I didn't see the ql.Bond constructor that takes redemption value, was that changed to something else?
Thanks a lot and look forward to your reply!