Cross Currency Swaps

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

Cross Currency Swaps

Brian Reilly-2
Does Quantlib have support for cross currency swaps?  Or fx forward contracts?
Reply | Threaded
Open this post in threaded view
|

Re: Cross Currency Swaps

Luigi Ballabio
On 11/30/2005 11:00:24 PM, Brian Reilly wrote:
> Does Quantlib have support for cross currency swaps?

Not yet. In order to do it, we'll have to change the instrument and  
cash-flow classes so that they return Money instances instead of  
doubles. It's in the todo list, but it's a rather major development.

In the meantime, you can reproduce the price with a bit of work. If the  
original swap pays, say, EUR vs USD, you'll have to:
1) initialize a Swap instance with the EUR leg plus a final simple  
cash-flow equal to the notional, an empty second leg, and the EUR  
discount curve;
2) initialize a second Swap instance with the USD leg + notional, an  
empty second leg, and the USD discount curve;
3) ask the two swaps for their NPV, convert one in the currency of the  
other, and subtract the two.


> Or fx forward contracts?

They're not in the library either.

Later,
        Luigi


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

There are two ways to write error-free programs; only the third one  
works.
-- unknown