qlIborLeg in QuantLibXL returns all forward floating coupons zero!

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

qlIborLeg in QuantLibXL returns all forward floating coupons zero!

chrarv
Hello to everyone
I am trying to price an amortized swap in QuantLibXL and for the floating leg (fixed leg works fine!) I am using the class qlIborLeg. After passing all the input parameters as schedule and amortization as well as the Ibor index (Euribor 6M in this case) the object is created without errors.
Then I use the swap class and pass it as the floating part of the swap class. It appears that all the floating forward cashflows of the swap are zero and the NPV of the swap is coming only from the fixed leg!!!
One can verify that indeed the forward floating coupons are all zero by using the qlSwapLegAnalysis function
What am I doing wrong please advise!
Thanks in advance for your help

Best
Christos Arvanitis  
Reply | Threaded
Open this post in threaded view
|

Re: qlIborLeg in QuantLibXL returns all forward floating coupons zero!

Luigi Ballabio
May you send the parameters you're passing to the calls?

Luigi


On Mon, Sep 19, 2016 at 9:19 PM chrarv <[hidden email]> wrote:
Hello to everyone
I am trying to price an amortized swap in QuantLibXL and for the floating
leg (fixed leg works fine!) I am using the class qlIborLeg. After passing
all the input parameters as schedule and amortization as well as the Ibor
index (Euribor 6M in this case) the object is created without errors.
Then I use the swap class and pass it as the floating part of the swap
class. It appears that all the floating forward cashflows of the swap are
zero and the NPV of the swap is coming only from the fixed leg!!!
One can verify that indeed the forward floating coupons are all zero by
using the qlSwapLegAnalysis function
What am I doing wrong please advise!
Thanks in advance for your help

Best
Christos Arvanitis



--
View this message in context: http://quantlib.10058.n7.nabble.com/qlIborLeg-in-QuantLibXL-returns-all-forward-floating-coupons-zero-tp17732.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: qlIborLeg in QuantLibXL returns all forward floating coupons zero!

chrarv
Hi Luigithem
Thanks for reverting
I will post tomorrow snips of my excel calculations.
Best
Christos
Reply | Threaded
Open this post in threaded view
|

Re: qlIborLeg in QuantLibXL returns all forward floating coupons zero!

christos.arvanitis
In reply to this post by Luigi Ballabio

Hi Luigi

I am sending you the excel screens as requested. Hope are easy to read

Best

Christos

 

 

 

 

 

 

 

 

 

From: Luigi Ballabio [mailto:[hidden email]]
Sent: Monday, September 19, 2016 10:21 PM
To: chrarv; [hidden email]
Subject: Re: [Quantlib-users] qlIborLeg in QuantLibXL returns all forward floating coupons zero!

 

May you send the parameters you're passing to the calls?

 

Luigi

 

 

On Mon, Sep 19, 2016 at 9:19 PM chrarv <[hidden email]> wrote:

Hello to everyone
I am trying to price an amortized swap in QuantLibXL and for the floating
leg (fixed leg works fine!) I am using the class qlIborLeg. After passing
all the input parameters as schedule and amortization as well as the Ibor
index (Euribor 6M in this case) the object is created without errors.
Then I use the swap class and pass it as the floating part of the swap
class. It appears that all the floating forward cashflows of the swap are
zero and the NPV of the swap is coming only from the fixed leg!!!
One can verify that indeed the forward floating coupons are all zero by
using the qlSwapLegAnalysis function
What am I doing wrong please advise!
Thanks in advance for your help

Best
Christos Arvanitis



--
View this message in context: http://quantlib.10058.n7.nabble.com/qlIborLeg-in-QuantLibXL-returns-all-forward-floating-coupons-zero-tp17732.html
Sent from the quantlib-users mailing list archive at Nabble.com.

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


MESSAGE CONFIDENTIALITY AND SECURITY NOTICE

=========================================

This message and/or its attachments may contain confidential and privileged information and is intended for the named person or entity to which it is addressed. Any use, copying or distribution of this information by anyone other than the intended recipient(s) is prohibited by law. If you receive this in error, please immediately delete it from your system and notify the sender.

The contents of this message contain personal opinions of the sender, which are not the official views of Piraeus Bank nor do they consist a provision of financial or advisory services unless expressly stated otherwise. This message is not a solicitation and/or an offer or acceptance of any proposal in relation to any contract or transaction unless expressly otherwise indicated in the message itself.

The Internet is not a secure or error-free environment, and Piraeus Bank does not accept liability for any loss or damage arising from the use of this message or from delayed, intercepted, corrupted or virus-infected e-mail transmission.

 


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

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

Re: qlIborLeg in QuantLibXL returns all forward floating coupons zero!

chrarv
In reply to this post by chrarv
Hi to everyone
I am posting here the excel screens describing the issue
If you need I can attach the excel sheet with the actual figures and the creation of the amortizing Ibor Leg

Best
Christos

Reply | Threaded
Open this post in threaded view
|

Re: qlIborLeg in QuantLibXL returns all forward floating coupons zero!

chrarv
Hello to everyone
I am posting a small excel illustrating the issue of zero cashflows
Please advise
Best
Christos Amort-Swap-Test.xlsx
Reply | Threaded
Open this post in threaded view
|

Re: qlIborLeg in QuantLibXL returns all forward floating coupons zero!

chrarv
In reply to this post by chrarv
Hello to everyone
Is that finally a bug?
Thanks
Christos
Reply | Threaded
Open this post in threaded view
|

Re: qlIborLeg in QuantLibXL returns all forward floating coupons zero!

chrarv
Hello
Has anyone had the chance to look at the excel file and see if indeed there is a bug or if I am doing something wrong there?
Please advise
Best
Christos
Reply | Threaded
Open this post in threaded view
|

Re: qlIborLeg in QuantLibXL returns all forward floating coupons zero!

chrarv
Hello
Apart the small excel example I have posted I have tried to price a Simple Vanilla amortizing Swap both in C++ and python using the exported bindings
I have remarked and report here! that in both cases (C++ and Python) IborLeg class returns 0 cash flows all the way across the schedule

For your reference in Python I report small piece of code that creates the IborLeg to be passed to the swap class

Assuming the 6M curve is build Euribor6M_curve_c

1.
euribor6M_calc=ql.Euribor6M(ql.YieldTermStructureHandle(Euribor6M_curve_c))



2.

amort_notional= [66552649.72,63806870.94,
           61784144.40,60029495.50,
           57468704.81,55759411.61,
           55712615.57,55404932.02,
           54947952.17,54944085.09,
           54940218.01,54936350.93,
           54926643.75,54582525.94,
           54206621.58,53841099.95,
           53481292.21,53025949.56,
           52572181.43,52084605.00,
           51560753.71,50964715.27,
           50345757.91,49696416.56,
           48995690.04,47915847.64,
           47111497.45,46247761.48,
           45362609.91,44468182.47,
           43569117.10,42996253.76,
           42186855.80,40817534.20,
           39350991.83,37780135.74,
           36955677.69,34646716.19,
           31723527.74,27859142.47,
           24338697.33,21105866.33,
           17461157.37,13352405.80,
           8720840.27,5174670.91
           ]



fixed_coupon_ms=[0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657]


swap_float_leg=ql.IborLeg(amort_notional,
                              MS_Float_schedule,
                              euribor6M_calc,
                              ql.Actual360(),
                              ql.ModifiedFollowing,
                              [fixingDays],
                              [0],              # floors
                              [0],              # Gearings
                              [0],              # Spreads
                              [0],              # caps
                              False)

the above returns all the coupons as zeros
Is that finally a BUG??

Please advise

Thanks in advance for your help
Christos
Reply | Threaded
Open this post in threaded view
|

Re: qlIborLeg in QuantLibXL returns all forward floating coupons zero!

Luigi Ballabio
Hello Christos,
    thanks for providing the Python code. That really makes me easier to see what's happening.

No, it's not a bug. You're passing vectors of zeros for the gearing, the caps and the floors. This means that you're multiplying the rate by zero (the gearing) and furthermore, you're forcing it to be between 0 and 0 (the cap and floor).  If you want the default values (gearing=1, no cap, no floor) you need to pass the empty list [] in Python and possibly an empty cell in Excel.

Hope this helps,
    Luigi


On Fri, Oct 14, 2016 at 6:03 PM chrarv <[hidden email]> wrote:
Hello
Apart the small excel example I have posted I have tried to price a Simple
Vanilla amortizing Swap both in C++ and python using the exported bindings
I have remarked and report here! that in both cases (C++ and Python) IborLeg
class returns 0 cash flows all the way across the schedule

For your reference in Python I report small piece of code that creates the
IborLeg to be passed to the swap class

Assuming the 6M curve is build Euribor6M_curve_c

1.
euribor6M_calc=ql.Euribor6M(ql.YieldTermStructureHandle(Euribor6M_curve_c))



2.

amort_notional= [66552649.72,63806870.94,
           61784144.40,60029495.50,
           57468704.81,55759411.61,
           55712615.57,55404932.02,
           54947952.17,54944085.09,
           54940218.01,54936350.93,
           54926643.75,54582525.94,
           54206621.58,53841099.95,
           53481292.21,53025949.56,
           52572181.43,52084605.00,
           51560753.71,50964715.27,
           50345757.91,49696416.56,
           48995690.04,47915847.64,
           47111497.45,46247761.48,
           45362609.91,44468182.47,
           43569117.10,42996253.76,
           42186855.80,40817534.20,
           39350991.83,37780135.74,
           36955677.69,34646716.19,
           31723527.74,27859142.47,
           24338697.33,21105866.33,
           17461157.37,13352405.80,
           8720840.27,5174670.91
           ]



fixed_coupon_ms=[0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657,0.047657,0.047657,
              0.047657]


swap_float_leg=ql.IborLeg(amort_notional,
                              MS_Float_schedule,
                              euribor6M_calc,
                              ql.Actual360(),
                              ql.ModifiedFollowing,
                              [fixingDays],
                              [0],              # floors
                              [0],              # Gearings
                              [0],              # Spreads
                              [0],              # caps
                              False)

the above returns all the coupons as zeros
Is that finally a BUG??

Please advise

Thanks in advance for your help
Christos



--
View this message in context: http://quantlib.10058.n7.nabble.com/qlIborLeg-in-QuantLibXL-returns-all-forward-floating-coupons-zero-tp17732p17805.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: qlIborLeg in QuantLibXL returns all forward floating coupons zero!

chrarv
Hello Luigi,
Thanks for your advise and Help much appreciated!
Indeed it works and there is no BUG!!! The solution was apparent silly me!
passing by is there a method for extracting all the flows instead of using the loop

for i, cf in enumerate(swap_Amort.leg(0)):
    print("%2d    %-18s  %10.2f"%(i+1, cf.date(), cf.amount()))

like

LegFlowAnalysis(float_leg,today)

Best
Christos
Reply | Threaded
Open this post in threaded view
|

Re: qlIborLeg in QuantLibXL returns all forward floating coupons zero!

Luigi Ballabio
No such method, sorry. Just the loop.

Luigi

On Mon, Oct 17, 2016 at 5:00 PM chrarv <[hidden email]> wrote:
Hello Luigi,
Thanks for your advise and Help much appreciated!
Indeed it works and there is no BUG!!! The solution was apparent silly me!
passing by is there a method for extracting all the flows instead of using
the loop

for i, cf in enumerate(swap_Amort.leg(0)):
    print("%2d    %-18s  %10.2f"%(i+1, cf.date(), cf.amount()))

like

LegFlowAnalysis(float_leg,today)

Best
Christos



--
View this message in context: http://quantlib.10058.n7.nabble.com/qlIborLeg-in-QuantLibXL-returns-all-forward-floating-coupons-zero-tp17732p17807.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: qlIborLeg in QuantLibXL returns all forward floating coupons zero!

christos.arvanitis

Thanks again

Christos

 

From: Luigi Ballabio [mailto:[hidden email]]
Sent: Monday, October 17, 2016 6:09 PM
To: chrarv; [hidden email]
Subject: Re: [Quantlib-users] qlIborLeg in QuantLibXL returns all forward floating coupons zero!

 

No such method, sorry. Just the loop.

 

Luigi

 

On Mon, Oct 17, 2016 at 5:00 PM chrarv <[hidden email]> wrote:

Hello Luigi,
Thanks for your advise and Help much appreciated!
Indeed it works and there is no BUG!!! The solution was apparent silly me!
passing by is there a method for extracting all the flows instead of using
the loop

for i, cf in enumerate(swap_Amort.leg(0)):
    print("%2d    %-18s  %10.2f"%(i+1, cf.date(), cf.amount()))

like

LegFlowAnalysis(float_leg,today)

Best
Christos



--
View this message in context: http://quantlib.10058.n7.nabble.com/qlIborLeg-in-QuantLibXL-returns-all-forward-floating-coupons-zero-tp17732p17807.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


MESSAGE CONFIDENTIALITY AND SECURITY NOTICE

=========================================

This message and/or its attachments may contain confidential and privileged information and is intended for the named person or entity to which it is addressed. Any use, copying or distribution of this information by anyone other than the intended recipient(s) is prohibited by law. If you receive this in error, please immediately delete it from your system and notify the sender.

The contents of this message contain personal opinions of the sender, which are not the official views of Piraeus Bank nor do they consist a provision of financial or advisory services unless expressly stated otherwise. This message is not a solicitation and/or an offer or acceptance of any proposal in relation to any contract or transaction unless expressly otherwise indicated in the message itself.

The Internet is not a secure or error-free environment, and Piraeus Bank does not accept liability for any loss or damage arising from the use of this message or from delayed, intercepted, corrupted or virus-infected e-mail transmission.

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users