|
From: Luigi B. <lui...@gm...> - 2024-03-05 10:28:58
|
Hi, some of the FixedRateBond constructors were deprecated in version 1.28 and then removed in version 1.33. You should now create a Schedule object and pass that to the bond constructor. You can see an example at < https://github.com/lballabio/QuantLib-SWIG/blob/v1.33/Python/examples/bonds.py#L204 >. Luigi On Mon, Mar 4, 2024 at 6:09 PM Amir Lakha <ami...@gm...> wrote: > Hi, > > I have some code where I was creating a FixedRateBond which was working > correctly in v1.32, however, I am getting the following error if I try > and run in v1.33: > > 25245 def __init__(self, *args, **kwargs): > 25246 r"""__init__(FixedRateBond self, Integer settlementDays, > Real faceAmount, Schedule schedule, DoubleVector coupons, DayCounter > paymentDayCounter, BusinessDayConvention > paymentConvention=QuantLib::Following, Real redemption=100.0, Date > issueDate=Date(), Calendar paymentCalendar=Calendar(), Period > exCouponPeriod=Period(), Calendar exCouponCalendar=Calendar(), > BusinessDayConvention exCouponConvention=Unadjusted, bool > exCouponEndOfMonth=False) -> FixedRateBond""" > > 25247 _QuantLib.FixedRateBond_swiginit(self, > _QuantLib.new_FixedRateBond(*args, **kwargs)) > > TypeError: in method 'new_FixedRateBond', argument 2 of type 'Real' > > The code I am using to initialise the FixedRateBond is : > > self.bond = ql.FixedRateBond(0, calendar, self.nominal, issueDate, > maturity, ql.Period(frequency), self.coupons, dayCount) > > The arguments being passed to the constructor are : > > > - SettleDays: 0 > - Calendar: TARGET calendar > - Face: 1000000 > - Start: November 14th, 2022 > - End: November 14th, 2032 > - Period: 1Y, Coupons: [0.08407], > - DayCount: 30/360 (Bond Basis) day counter > > > Any idea what I am doing wrong? > > kind regards, > > Amir > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |