Quantlib Python - Issue with CallabilitySchedule with CallableFixedRateBond

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Quantlib Python - Issue with CallabilitySchedule with CallableFixedRateBond

Barber, Chad

I am using the pre-compiled Python version of Quantlib from the following website (<a href="javascript:;" title="[4.7&nbsp;MB] [Sep 12, 2015]">QuantLib_Python-1.6.1-cp27-none-win_amd64.whl)

 

http://www.lfd.uci.edu/~gohlke/pythonlibs/#quantlib

 

When the code below is run it returns the following error:

 

TypeError: in method 'new_CallableFixedRateBond', argument 9 of type 'CallabilitySchedule const &':

 

 

schedule = Schedule(Date(25,January,2010), Date(1,February,2020), Period(Semiannual), TARGET(), 

                    ModifiedFollowing, ModifiedFollowing, DateGeneration.Backward, False)

call_dates = [ ql.Date(25,January,2016) ]

call_price = 100.0

callability_schedule = ql.CallabilitySchedule()

for call_date in call_dates:

   callability_price  = ql.CallabilityPrice(call_price, ql.CallabilityPrice.Clean)

   callability_schedule.append(ql.Callability(callability_price, ql.Callability.Call, call_date))

bond = ql.CallableFixedRateBond(3, 100.0, schedule, [0.0565], ql.Thirty360(), ql.ModifiedFollowing, 100.0,  ql.Date(25,January,2010), callability_schedule)

Does anyone know why this error is being raised?

 


This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.

------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Quantlib Python - Issue with CallabilitySchedule with CallableFixedRateBond

Gouthaman Balaraman
Hey Chad
I remember encountering a similar issue, and my fix seems to have gotten into V1.8:


Can you try in version 1.8 instead of 1.6?

Goutham



On Mon, Aug 15, 2016 at 2:00 PM, Barber, Chad <[hidden email]> wrote:

I am using the pre-compiled Python version of Quantlib from the following website (QuantLib_Python-1.6.1-cp27-none-win_amd64.whl)

 

http://www.lfd.uci.edu/~gohlke/pythonlibs/#quantlib

 

When the code below is run it returns the following error:

 

TypeError: in method 'new_CallableFixedRateBond', argument 9 of type 'CallabilitySchedule const &':

 

 

schedule = Schedule(Date(25,January,2010), Date(1,February,2020), Period(Semiannual), TARGET(), 

                    ModifiedFollowing, ModifiedFollowing, DateGeneration.Backward, False)

call_dates = [ ql.Date(25,January,2016) ]

call_price = 100.0

callability_schedule = ql.CallabilitySchedule()

for call_date in call_dates:

   callability_price  = ql.CallabilityPrice(call_price, ql.CallabilityPrice.Clean)

   callability_schedule.append(ql.Callability(callability_price, ql.Callability.Call, call_date))

bond = ql.CallableFixedRateBond(3, 100.0, schedule, [0.0565]ql.Thirty360(), ql.ModifiedFollowing, 100.0,  ql.Date(25,January,2010), callability_schedule)

Does anyone know why this error is being raised?

 


This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.

------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users