Login  Register

Re: C++ AssetSwap test port to Python

Posted by Lluis Pujol Bajador on Oct 11, 2011; 6:34pm
URL: http://quantlib.414.s1.nabble.com/C-AssetSwap-test-port-to-Python-tp347p349.html

El 12/09/2011 18:19, Luigi Ballabio escribió:

> On Fri, 2011-08-12 at 12:07 +0200, LLUIS PUJOL BAJADOR wrote:
>> Please find attached the Assetswap test port to Python. It works quite
>> well with the exception of the following issue that I cannot figure
>> out how to solve.
> Lluis,
> you're initializing the IborLeg in the wrong way:
>
>>          floatingBondLeg1 =
>> list(IborLeg([self.faceAmount],floatingBondSchedule1, self.iborIndex,
>>
>> Actual360(),Following,[fixingDays],[],[0.0056],[inArrears]))
Thanks Luigi,
Sorry for the Delay
I cannot believe I didn't figure it out. I reviewed all related Library
code and I had it in front of my eyes.


> After [0.0056] for the spreads, you'll need to pass two more empty lists
> for caps and floors.  Also, the boolear inArrears should not be inside a
> list, otherwise Python will convert the _list_ into a boolean (and since
> it's not empty, it will be true no matter what's inside.)  The correct
> call is:
>
> IborLeg([self.faceAmount],floatingBondSchedule1, self.iborIndex,
>          Actual360(),Following,[fixingDays],[],[0.0056],[],[],inArrears)
>
> I've added your modifications to the SWIG interface to the svn trunk, so
> if you check it out you should be able to build the Python module and
> run your tests against it.  I've not added the tests to svn; please send
> them back to me when they work for you.
>
> Thanks,
> Luigi
>
>
Please find attached an updated version with the errors solved. It works
for me with the wrappers included in the trunk.
Just a quick (and dumb) question. How do you format the text in order to
fit with the required widht?.
I mean I've looked at the cms.py test that I provided and you have
reformatted it before including it in the trunk. Is there an "automated"
way?.








------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

assetswap.rar (14K) Download Attachment