QuantLib::Bond::cleanPriceFromZSpread

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

QuantLib::Bond::cleanPriceFromZSpread

gigifaye29
Can anyone help clarify my question?

In the CallableBonds Class,  does the member function "cleanPriceFromZSpread(...)"  calculate a clean price by discounting the  *unadjusted* cash flows, OR  *adjusted* cash flows(prices on each note revised to strike if option in the money),  by interest tree note rates plus z-spread?

I got confused because the terminology z-spread(zero volatility spread) is used in non-option setting but if this function simply just discounts all unadjusted cashflows then it is not special to this callable bond class anymore.  

If it does discount adjusted cashflows, then shouldn't the spread called OAS instead of z-spread?

Appreciate your correction on my misunderstanding,
Xinc
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Luigi Ballabio
On Tue, 2009-02-24 at 13:49 -0800, gigifaye29 wrote:
> In the CallableBonds Class,  does the member function
> "cleanPriceFromZSpread(...)"  calculate a clean price by discounting the
> *unadjusted* cash flows, OR  *adjusted* cash flows(prices on each note
> revised to strike if option in the money),  by interest tree note rates plus
> z-spread?

Unadjusted. The method is inherited from the generic Bond class and does
not take callability into account.

Luigi


--

Testing can never demonstrate the absence of errors in software, only
their presence.
-- W.E. Dijkstra



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

gigifaye29
Thanks. Just one more question on this topic

For parameters to feed the pricing engines,  volatility and reversion in particular,  are the functions taking *annualized* numbers?

Thx again,
Xinc

Luigi Ballabio wrote
On Tue, 2009-02-24 at 13:49 -0800, gigifaye29 wrote:
> In the CallableBonds Class,  does the member function
> "cleanPriceFromZSpread(...)"  calculate a clean price by discounting the
> *unadjusted* cash flows, OR  *adjusted* cash flows(prices on each note
> revised to strike if option in the money),  by interest tree note rates plus
> z-spread?

Unadjusted. The method is inherited from the generic Bond class and does
not take callability into account.

Luigi


--

Testing can never demonstrate the absence of errors in software, only
their presence.
-- W.E. Dijkstra



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
QuantLib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

gigifaye29
In reply to this post by Luigi Ballabio
Is the .npv() function in callablebond class inherited from the generic bond class, or it is overridden in the callablebond?

If it is latter than I should expect it is the npv of adjusted cash flows.  Seems to me the npv calculation is sensitive the tree volatility assumption, but when I try a bond that will be called on the evaluation date the npv is not capped to the strike price.

Appreciate if you can also shed some light on this,
Xinc



Luigi Ballabio wrote
On Tue, 2009-02-24 at 13:49 -0800, gigifaye29 wrote:
> In the CallableBonds Class,  does the member function
> "cleanPriceFromZSpread(...)"  calculate a clean price by discounting the
> *unadjusted* cash flows, OR  *adjusted* cash flows(prices on each note
> revised to strike if option in the money),  by interest tree note rates plus
> z-spread?

Unadjusted. The method is inherited from the generic Bond class and does
not take callability into account.

Luigi


--

Testing can never demonstrate the absence of errors in software, only
their presence.
-- W.E. Dijkstra



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
QuantLib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Luigi Ballabio
In reply to this post by gigifaye29
On Fri, 2009-02-27 at 07:58 -0800, gigifaye29 wrote:
> Thanks. Just one more question on this topic
>
> For parameters to feed the pricing engines,  volatility and reversion in
> particular,  are the functions taking *annualized* numbers?

Yes.

Luigi


--

Don't let school get in the way of your education.
-- Mark Twain



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Luigi Ballabio
In reply to this post by gigifaye29
On Fri, 2009-02-27 at 14:54 -0800, gigifaye29 wrote:
> Is the .npv() function in callablebond class inherited from the generic bond
> class, or it is overridden in the callablebond?

Technically, it's not; but NPV() delegates the calculation to the
pricing engine, so callable bonds are priced correctly if you set the
correct engine.

> Seems to me the npv calculation is sensitive the tree volatility assumption,
> but when I try a bond that will be called on the evaluation date the npv is
> not capped to the strike price.

If the call date equals the evaluation date, the engine might consider
it as expired. What happens if you try a bond that will be called one
day after the evaluation date?

Luigi


--

The box said "Use Windows 95 or better," so I got a Macintosh.



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

gigifaye29
In reply to this post by gigifaye29
If the call date equals the evaluation date, the engine might consider it as expired. What happens if you try a bond that will be called one day after the evaluation date?

Luigi

*****
Thanks Luigi.  Isn't that though, if the engine( I am using Hull-White) considers it as expired, the price should be very close to strike?
Yes I tried using the evaluation date just before the next call date,  the calculated price still not capped to strike as I would expect.

Am I missing anything here?

Thx,
Xinc
*****



gigifaye29 wrote
Can anyone help clarify my question?

In the CallableBonds Class,  does the member function "cleanPriceFromZSpread(...)"  calculate a clean price by discounting the  *unadjusted* cash flows, OR  *adjusted* cash flows(prices on each note revised to strike if option in the money),  by interest tree note rates plus z-spread?

I got confused because the terminology z-spread(zero volatility spread) is used in non-option setting but if this function simply just discounts all unadjusted cashflows then it is not special to this callable bond class anymore.  

If it does discount adjusted cashflows, then shouldn't the spread called OAS instead of z-spread?

Appreciate your correction on my misunderstanding,
Xinc
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Guowen Han

Conceptually, Z-Spread is calculated from one interest rate scenario, for example zero curve. Why Hull-White model is used?
Look at the implementation, the dirtyPriceFromZSpreadFunction() only use the cashflow (coupons) and discount with the spreadedCurve as the discount curve. There is no option involved at all.

I have been thinking of how to implement a member function to calculate the OAS (option adjusted spread) and price from OAS. In fact, such a function will be much useful than Yield practically and Z-Spread should be only its simple case. However, with currently design,  for each iteration for OAS finding, a new curve has to be initialized and is not efficient. It would be much easier and efficient if the rollback function can accept a spread parameter.

I may be wrong about it.

Thanks,
 



gigifaye29 <[hidden email]>

03/02/2009 11:11 AM

To
[hidden email]
cc
Subject
Re: [Quantlib-users] QuantLib::Bond::cleanPriceFromZSpread






If the call date equals the evaluation date, the engine might consider it as
expired. What happens if you try a bond that will be called one day after
the evaluation date?

Luigi

*****
Thanks Luigi.  Isn't that though, if the engine( I am using Hull-White)
considers it as expired, the price should be very close to strike?
Yes I tried using the evaluation date just before the next call date,  the
calculated price still not capped to strike as I would expect.

Am I missing anything here?

Thx,
Xinc
*****




gigifaye29 wrote:
>
> Can anyone help clarify my question?
>
> In the CallableBonds Class,  does the member function
> "cleanPriceFromZSpread(...)"  calculate a clean price by discounting the
> *unadjusted* cash flows, OR  *adjusted* cash flows(prices on each note
> revised to strike if option in the money),  by interest tree note rates
> plus z-spread?
>
> I got confused because the terminology z-spread(zero volatility spread) is
> used in non-option setting but if this function simply just discounts all
> unadjusted cashflows then it is not special to this callable bond class
> anymore.  
>
> If it does discount adjusted cashflows, then shouldn't the spread called
> OAS instead of z-spread?
>
> Appreciate your correction on my misunderstanding,
> Xinc
>

--
View this message in context: http://www.nabble.com/QuantLib%3A%3ABond%3A%3AcleanPriceFromZSpread-tp22183771p22291035.html
Sent from the quantlib-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


________________________________________________________
DTCC DISCLAIMER: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please notify us immediately and delete the email and any attachments from your system. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

gigifaye29
I think you are right on the z-spread calculation - no option pricing engine involved, as Luigi 's previous, it was inherited from generic bond class. I used HW is because I feed the pricing engine for the .npv() calculation which adjusts optionality.

I too need to calculate OAS. I think OAS calculation by Quantlib is on their to-do list.  

One thing I still haven't figured out is that, .npv() gives me a value beyond strike(not capped) in the situation that the option is in money....

Xinc





Guowen Han wrote
Conceptually, Z-Spread is calculated from one interest rate scenario, for
example zero curve. Why Hull-White model is used?
Look at the implementation, the dirtyPriceFromZSpreadFunction() only use
the cashflow (coupons) and discount with the spreadedCurve as the discount
curve. There is no option involved at all.

I have been thinking of how to implement a member function to calculate
the OAS (option adjusted spread) and price from OAS. In fact, such a
function will be much useful than Yield practically and Z-Spread should be
only its simple case. However, with currently design,  for each iteration
for OAS finding, a new curve has to be initialized and is not efficient.
It would be much easier and efficient if the rollback function can accept
a spread parameter.

I may be wrong about it.

Thanks,
 




gigifaye29 <xin.chen@tdam.com> 
03/02/2009 11:11 AM

To
quantlib-users@lists.sourceforge.net
cc

Subject
Re: [Quantlib-users] QuantLib::Bond::cleanPriceFromZSpread







If the call date equals the evaluation date, the engine might consider it
as
expired. What happens if you try a bond that will be called one day after
the evaluation date?

Luigi

*****
Thanks Luigi.  Isn't that though, if the engine( I am using Hull-White)
considers it as expired, the price should be very close to strike?
Yes I tried using the evaluation date just before the next call date,  the
calculated price still not capped to strike as I would expect.

Am I missing anything here?

Thx,
Xinc
*****




gigifaye29 wrote:
>
> Can anyone help clarify my question?
>
> In the CallableBonds Class,  does the member function
> "cleanPriceFromZSpread(...)"  calculate a clean price by discounting the

> *unadjusted* cash flows, OR  *adjusted* cash flows(prices on each note
> revised to strike if option in the money),  by interest tree note rates
> plus z-spread?
>
> I got confused because the terminology z-spread(zero volatility spread)
is
> used in non-option setting but if this function simply just discounts
all
> unadjusted cashflows then it is not special to this callable bond class
> anymore.
>
> If it does discount adjusted cashflows, then shouldn't the spread called
> OAS instead of z-spread?
>
> Appreciate your correction on my misunderstanding,
> Xinc
>

--
View this message in context:
http://www.nabble.com/QuantLib%3A%3ABond%3A%3AcleanPriceFromZSpread-tp22183771p22291035.html

Sent from the quantlib-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source code:
SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
QuantLib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users



-----------------------------------------
________________________________________________________
DTCC DISCLAIMER: This email and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom they are addressed. If you have received this email
in error, please notify us immediately and delete the email and any
attachments from your system. The recipient should check this email
and any attachments for the presence of viruses.  The company
accepts no liability for any damage caused by any virus transmitted
by this email.
 
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
QuantLib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Ferdinando Ametrano-4
In reply to this post by Guowen Han
On Tue, Mar 3, 2009 at 7:36 PM, Guowen Han <[hidden email]> wrote:
> It would be
> much easier and efficient if the rollback function can accept a spread
> parameter.

what do you mean by rollback function?

ciao -- Nando

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Guowen Han

The rollback function is essentially discounting the cashflow using the underling term structure, right? If we can apply the discount with spread, the current value will be spread adjusted.

Thanks,



Ferdinando Ametrano <[hidden email]>

03/04/2009 05:09 AM

To
Guowen Han/DTCC@DTCC
cc
gigifaye29 <[hidden email]>, [hidden email]
Subject
Re: [Quantlib-users] QuantLib::Bond::cleanPriceFromZSpread





On Tue, Mar 3, 2009 at 7:36 PM, Guowen Han <[hidden email]> wrote:
> It would be
> much easier and efficient if the rollback function can accept a spread
> parameter.

what do you mean by rollback function?

ciao -- Nando

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


________________________________________________________
DTCC DISCLAIMER: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please notify us immediately and delete the email and any attachments from your system. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Guowen Han
In reply to this post by gigifaye29

I don't think there is such a thing implemented in QuantLib. This may be also a good candidate for the ToDo list.

Thanks,



"Chen, Xin" <[hidden email]>

03/04/2009 10:21 AM

To
Guowen Han/DTCC@DTCC
cc
Subject
RE: [Quantlib-users] QuantLib::Bond::cleanPriceFromZSpread





right, I understand that.  I suppose .npv() gives us a present value by discounting the *adjusted* cash flows with treausre term structure plus OAS.  
 
But if my evaluation day is on the same day as the callable day,  the .npv() result should be capped to the strike price, isn't it?
Or as you mentioned, there was something I have missed to specify the callable notification so the pricing engine takes that into account....?

From: Guowen Han [mailto:[hidden email]]
Sent:
Wednesday, March 04, 2009 10:15 AM
To:
Ferdinando Ametrano
Cc:
[hidden email]; Chen, Xin
Subject:
Re: [Quantlib-users] QuantLib::Bond::cleanPriceFromZSpread



The rollback function is essentially discounting the cashflow using the underling term structure, right? If we can apply the discount with spread, the current value will be spread adjusted.


Thanks,



Ferdinando Ametrano <[hidden email]>

03/04/2009 05:09 AM


To
Guowen Han/DTCC@DTCC
cc
gigifaye29 <[hidden email]>, [hidden email]
Subject
Re: [Quantlib-users] QuantLib::Bond::cleanPriceFromZSpread







On Tue, Mar 3, 2009 at 7:36 PM, Guowen Han <[hidden email]> wrote:
> It would be
> much easier and efficient if the rollback function can accept a spread
> parameter.

what do you mean by rollback function?

ciao -- Nando

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



________________________________________________________

DTCC DISCLAIMER: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please notify us immediately and delete the email and any attachments from your system. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.


*********************
NOTICE OF CONFIDENTIALITY
This communication including any information transmitted with it is
intended only for the use of the addressees and is confidential.
If you are not an intended recipient or responsible for delivering
the message to an intended recipient, any review, disclosure,
conversion to hard copy, dissemination, reproduction or other use
of any part of this communication is strictly prohibited, as is the
taking or omitting of any action in reliance upon this communication.
If you receive this communication in error or without authorization
please notify us immediately by return e-mail or otherwise and
permanently delete the entire communication from any computer,
disk drive, or other storage medium.

If the above disclaimer is not properly readable, it can be found at

www.td.com/legal

AVERTISSEMENT DE CONFIDENTIALITE
Ce courriel, ainsi que tout renseignement ci-inclus, destiné uniquement
aux destinataires susmentionnés, est confidentiel. Si vous
n'êtes pas le destinataire prévu ou un agent responsable de la
livraison de ce courriel, tout examen, divulgation, copie, impression,
reproduction, distribution, ou autre utilisation d'une partie de ce
courriel est strictement interdit de même que toute intervention ou
abstraction à cet égard. Si vous avez reçu ce message par erreur ou
sans autorisation, veuillez en aviser immédiatement l'expéditeur par
retour de courriel ou par un autre moyen et supprimer immédiatement
cette communication entière de tout système électronique.

Si l'avis de non-responsabilité ci-dessus n'est pas lisible, vous
pouvez le consulter à
www.td.com/francais/legale

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Luigi Ballabio
In reply to this post by gigifaye29
On Tue, 2009-03-03 at 11:05 -0800, gigifaye29 wrote:
> [ about callable bonds ]One thing I still haven't figured out is
> that, .npv() gives me a value beyond strike(not capped) in the
> situation that the option is in money....

Does the bond have other call dates after this one? And when you say
that the option is in the money, do you mean that the strike is greater
than the price of the underlying bond with or without the other call
dates?  It might be that the option is in the money, but the pricer is
calculating that holding the option will give a better payoff on one of
the future call dates.

Luigi


--

There is no such thing as public opinion. There is only published
opinion.
-- Winston Churchill



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Luigi Ballabio
In reply to this post by Guowen Han
On Tue, 2009-03-03 at 13:36 -0500, Guowen Han wrote:
> with currently design,  for each iteration for OAS finding, a new
> curve has to be initialized and is not efficient.

That's true for the current implementation, but that's not necessary.
Now the function creates a new spread quote and a new spreaded curve at
each iteration, but it wouldn't be hard to change it so that it creates
the quote and the spreaded curve just once and it just changes the quote
value at each iteration.

Luigi


--

If I do not want others to quote me, I do not speak.
-- Phil Wayne



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Guowen Han-3
Well, I tend to agree with your comment. But that will break original design, and maintain the quote won't be a simple task.

Guowen

 


> From: [hidden email]
> To: [hidden email]
> Date: Thu, 5 Mar 2009 11:08:25 +0100
> CC: [hidden email]; [hidden email]
> Subject: Re: [Quantlib-users] QuantLib::Bond::cleanPriceFromZSpread
>
> On Tue, 2009-03-03 at 13:36 -0500, Guowen Han wrote:
> > with currently design, for each iteration for OAS finding, a new
> > curve has to be initialized and is not efficient.
>
> That's true for the current implementation, but that's not necessary.
> Now the function creates a new spread quote and a new spreaded curve at
> each iteration, but it wouldn't be hard to change it so that it creates
> the quote and the spreaded curve just once and it just changes the quote
> value at each iteration.
>
> Luigi
>
>
> --
>
> If I do not want others to quote me, I do not speak.
> -- Phil Wayne
>
>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users


Hotmail® is up to 70% faster. Now good news travels really fast. Find out more.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Guowen Han-3
In reply to this post by Luigi Ballabio

Luigi,
 
If no other costs are considered, it should be optimal for the bond issuer to exercise the call option whenever it becomes in the money except for negative interest rate.
 
Thanks, 

Guowen


 

> From: [hidden email]
> To: [hidden email]
> Date: Thu, 5 Mar 2009 11:04:20 +0100
> CC: [hidden email]
> Subject: Re: [Quantlib-users] QuantLib::Bond::cleanPriceFromZSpread
>
> On Tue, 2009-03-03 at 11:05 -0800, gigifaye29 wrote:
> > [ about callable bonds ]One thing I still haven't figured out is
> > that, .npv() gives me a value beyond strike(not capped) in the
> > situation that the option is in money....
>
> Does the bond have other call dates after this one? And when you say
> that the option is in the money, do you mean that the strike is greater
> than the price of the underlying bond with or without the other call
> dates? It might be that the option is in the money, but the pricer is
> calculating that holding the option will give a better payoff on one of
> the future call dates.
>
> Luigi
>
>
> --
>
> There is no such thing as public opinion. There is only published
> opinion.
> -- Winston Churchill
>
>
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users


Express your personality in color! Preview and select themes for Hotmail®. See how.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Luigi Ballabio
On Thu, 2009-03-05 at 22:22 -0500, Guowen Han wrote:
> If no other costs are considered, it should be optimal for the bond
> issuer to exercise the call option whenever it becomes in the money
> except for negative interest rate.

Ok. I guess we'll need some example code to see what's wrong, then...

Luigi


--

Use every man after his desert, and who shall scape whipping?
-- Hamlet, Act II, scene II



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Luigi Ballabio
In reply to this post by Guowen Han-3
On Thu, 2009-03-05 at 22:09 -0500, Guowen Han wrote:
> Well, I tend to agree with your comment. But that will break original
> design

Not the design, it's just implementation (it's a helper function in an
anonymous namespace.)

> and maintain the quote won't be a simple task.

instead of the current

Real dirtyPriceFromZSpreadFunction(..., Spread zSpread, ...) {
    - create the quote
    - create the spreaded curve
    - discount the coupons
    - return the price
}

you'll have:

class dirtyPriceFromZSpreadFunction {
    shared_ptr<SimpleQuote> quote_;
    ...
  public:
    dirtyPriceFromZSpreadFunction(... arguments except spread ...) {
        - create the quote
        - create the spreaded curve
    }
    Real operator()(Spread zSpread) {
        quote_->setValue(zSpread);
        - discount the coupons (or better yet, call CashFlows::npv)
        - return the price
    }
};


Luigi


--

feature, n:
A surprising property of a program. Occasionally documented.
To call a property a feature sometimes means the author did not
consider that case, and the program makes an unexpected, though
not necessarily wrong response. See BUG. "That's not a bug,
it's a feature!" A bug can be changed to a feature by
documenting it.



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Guowen Han-3

We are right on the dirtyPriceFromZSpreadFunction().
We are actually talking about different issue. I was talking about the OAS finding.
Do you have any idea how should it be done efficiently?
 
Thanks,
 
Guowen



 

> Subject: RE: [Quantlib-users] QuantLib::Bond::cleanPriceFromZSpread
> From: [hidden email]
> To: [hidden email]
> CC: [hidden email]
> Date: Fri, 6 Mar 2009 13:11:40 +0100
>
> On Thu, 2009-03-05 at 22:09 -0500, Guowen Han wrote:
> > Well, I tend to agree with your comment. But that will break original
> > design
>
> Not the design, it's just implementation (it's a helper function in an
> anonymous namespace.)
>
> > and maintain the quote won't be a simple task.
>
> instead of the current
>
> Real dirtyPriceFromZSpreadFunction(..., Spread zSpread, ...) {
> - create the quote
> - create the spreaded curve
> - discount the coupons
> - return the price
> }
>
> you'll have:
>
> class dirtyPriceFromZSpreadFunction {
> shared_ptr<SimpleQuote> quote_;
> ...
> public:
> dirtyPriceFromZSpreadFunction(... arguments except spread ...) {
> - create the quote
> - create the spreaded curve
> }
> Real operator()(Spread zSpread) {
> quote_->setValue(zSpread);
> - discount the coupons (or better yet, call CashFlows::npv)
> - return the price
> }
> };
>
>
> Luigi
>
>
> --
>
> feature, n:
> A surprising property of a program. Occasionally documented.
> To call a property a feature sometimes means the author did not
> consider that case, and the program makes an unexpected, though
> not necessarily wrong response. See BUG. "That's not a bug,
> it's a feature!" A bug can be changed to a feature by
> documenting it.
>
>


Windows Live™ Contacts: Organize your contact list. Check it out.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: QuantLib::Bond::cleanPriceFromZSpread

Luigi Ballabio
On Sat, 2009-03-07 at 08:14 -0500, Guowen Han wrote:
>
> We are right on the dirtyPriceFromZSpreadFunction().
> We are actually talking about different issue. I was talking about the
> OAS finding.
> Do you have any idea how should it be done efficiently?

Right now, I'm not even sure that I know how to do it inefficiently :)
I think I wouldn't care that much about efficiency the first round of
coding, though. Are you willing to work on this, by the way?

Luigi


--

The First Rule of Optimization: Don't do it.
The Second Rule of Optimization (For experts only): Don't do it yet.
-- Michael Jackson



------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users