QuantlibXL: how to create Leg object?

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

QuantlibXL: how to create Leg object?

Marek Ozana
Hi,
I am reading through the 'Leg' help section of QuantlibXL and I fail
to understand how to construct a Leg object. Which function is used?
It seems like if all qlLeg... functions work on already existing Leg
object.
Is there any simple way to construct Leg object from already existing
qlFixedRateBond object? Could somebody post a simple example?
Thank you for your time and help!
 Marek Ozana

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantlibXL: how to create Leg object?

Ferdinando M. Ametrano-3
Hi Marek

On Wed, Nov 19, 2008 at 8:50 PM, Marek Ozana <[hidden email]> wrote:
> I am reading through the 'Leg' help section of QuantlibXL and I fail
> to understand how to construct a Leg object. Which function is used?
qlFixedRateLeg, qlIborLeg, qlDigitalIborLeg, qlCmsLeg, etc

> It seems like if all qlLeg... functions work on already existing Leg
> object.
right. Leg is the base class, so every qlLegXXX is just XXX base class
method call

> Is there any simple way to construct Leg object from already existing
> qlFixedRateBond object?
Probably not. try the other way: build the leg, then use it for
instantiating the bond. This way you'll have both in a coherent way.

hope it helps

ciao -- Nando

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantlibXL: how to create Leg object?

Marek Ozana
Thank you Ferdinando for your help and suggestions!
You are right, I missed the definition of qlFixedRateLeg in the
manual. Unfortunately I am still struggling with the qlFixedRateLeg.
My goal is to calculate duration of a bond (and possible even KRD -
i.e. duration of all cash-flows flows in certain period). I try to
perform the following steps:
1. Create Leg form the Schedule and bond coupons
2. Use qlLegDuration(..)
I have run into the following problems:
- It seems that the leg contains only the coupon payments and not the
final face value redemption. I haven't found out how to add it there.
How do you create leg including both coupons and face value payment?
- What should I pass as "InterestRate" object in qlLegDuration? Should
it be qlPiecewiseYieldCurve?

It would be of great help if somebody could post a simple example with
Leg construction (including the nominal payment at maturity) and
duration calculations. Please find attached my simple attempt to
perform the above calculations. The leg is constructed on row 2 and
analyzed using qlLegAnalysis. It clearly misses the face value payment
at maturity date (see D29).

  Thank you for your help and time!

    /Marek





On Fri, Nov 21, 2008 at 11:39 AM, Ferdinando Ametrano
<[hidden email]> wrote:

> Hi Marek
>
> On Wed, Nov 19, 2008 at 8:50 PM, Marek Ozana <[hidden email]> wrote:
>> I am reading through the 'Leg' help section of QuantlibXL and I fail
>> to understand how to construct a Leg object. Which function is used?
> qlFixedRateLeg, qlIborLeg, qlDigitalIborLeg, qlCmsLeg, etc
>
>> It seems like if all qlLeg... functions work on already existing Leg
>> object.
> right. Leg is the base class, so every qlLegXXX is just XXX base class
> method call
>
>> Is there any simple way to construct Leg object from already existing
>> qlFixedRateBond object?
> Probably not. try the other way: build the leg, then use it for
> instantiating the bond. This way you'll have both in a coherent way.
>
> hope it helps
>
> ciao -- Nando
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

Quantlib-Leg-Constructions-frozen.xls (39K) Download Attachment