Re: shortSwapIndexBase in SwaptionVolCube2 (AUD as example)

Posted by Yan Kuang on
URL: http://quantlib.414.s1.nabble.com/reference-of-boost-shared-ptr-instead-of-Handle-tp7623p7643.html


Hi Luigi,

I don't think we need to reverting the change, I think my suggestion will work, please give a comment
on my email from yesterday (and I retached below).

Cheers,
Yan

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Nando and Luigi,

A suggestion:

EuriborSwap::EuriborSwap(const Period& tenor,
                  const Handle<YieldTermStructure>& fdw6M,
             const Handle<YieldTermStructure>& fdw3M,
             const Handle<YieldTermStructure>& discount)


...

            tenor > 1*Years ?
                      boost::shared_ptr<IborIndex>(new EURLibor(6*Months,
fdw6M)) :
                      boost::shared_ptr<IborIndex>(new EURLibor(3*Months,
fdw3M))) {}

...

Add two data members (private) to EuriborSwap
                  Handle<YieldTermStructure> fdw6M_;        
             Handle<YieldTermStructure> fdw3M_;


Add one data member (protected) in swapIndex

             Handle<YieldTermStructure> discount_;        


So that:

EurLiborSwap::create(const Period& tenor) const {
    return boost::shared_ptr<SwapIndex>(
                   new EurLiborSwap(tenor,
fdw6M_, fdw3M_, discount_);


This will work, and it's not too bad as we hide swapIndex definition from
SwaptionVolCube.

Alternatively we may decouple index from yield curve (market data), and add an association:

map<std::string, Handle<YieldTermStructure> > curveMap; //market date association

curveMap.insert(std::pair<std::string, Handle<YieldTermStructure> >("EURLibor6M", fdw6M);

But too much works involved.

Cheers,
Yan


Luigi Ballabio <[hidden email]>

16/09/2009 06:08 PM

Please respond to
[hidden email]

To
"Ferdinando M. Ametrano" <[hidden email]>
cc
Yan Kuang <[hidden email]>, [hidden email]
Subject
Re: [Quantlib-users] shortSwapIndexBase in SwaptionVolCube2 (AUD as example)





On Tue, 2009-09-15 at 17:33 +0200, Ferdinando M. Ametrano wrote:
> 1) The current market practice is to have a different discount curve
>
> 2) two different forwarding curves must be used.

Right. I was stuck in 2007.
Ok, I'm reverting the change until we figure it out.

Later,
                Luigi


--

Ninety percent of everything is crap.
--- Theodore Sturgeon




Please consider our environment before printing this email.

WARNING - This email and any attachments may be confidential. If received in error, please delete and inform us by return email. Because emails and attachments may be interfered with, may contain computer viruses or other defects and may not be successfully replicated on other systems, you must be cautious. Westpac cannot guarantee that what you receive is what we sent. If you have any doubts about the authenticity of an email by Westpac, please contact us immediately.

It is also important to check for viruses and defects before opening or using attachments. Westpac's liability is limited to resupplying any affected attachments.

This email and its attachments are not intended to constitute any form of financial advice or recommendation of, or an offer to buy or offer to sell, any security or other financial product. We recommend that you seek your own independent legal or financial advice before proceeding with any investment decision.

Westpac Institutional Bank is a division of Westpac Banking Corporation, a company registered in New South Wales in Australia under the Corporations Act 2001 (Cth). Westpac is authorised and regulated in the United Kingdom by the Financial Services Authority and is registered at Cardiff in the United Kingdom as Branch No. BR 106. Westpac operates in the United States of America as a federally chartered branch, regulated by the Office of the Comptroller of the Currency.

Westpac Banking Corporation ABN 33 007 457 141.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users