Re: QuantLib::Bond::cleanPriceFromZSpread

Posted by Guowen Han-3 on
URL: http://quantlib.414.s1.nabble.com/QuantLib-Bond-cleanPriceFromZSpread-tp7310p7316.html


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