Login  Register

Re: C++ AssetSwap test port to Python

Posted by Luigi Ballabio on Sep 12, 2011; 4:19pm
URL: http://quantlib.414.s1.nabble.com/C-AssetSwap-test-port-to-Python-tp347p348.html

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]))

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


--

For every problem there is one solution which is simple, neat, and
wrong.
-- H. L. Mencken



------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users