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-tp7623p7645.html



Luigi Ballabio <[hidden email]> wrote on 17/09/2009 06:40:55 PM:

> On Thu, 2009-09-17 at 09:02 +1000, Yan Kuang wrote:
> > 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).
>
> Yes, I'm sure it will work.  However, it's a bigger change, and I'm not
> sure that the resulting interface is the one we want in the end.  We'll
> have to think a bit more about it.
>
> For instance, about the sketch you made:
>
> > EuriborSwap::EuriborSwap(const Period& tenor,
> >                   const Handle<YieldTermStructure>& fdw6M,
> >              const Handle<YieldTermStructure>& fdw3M,
> >              const Handle<YieldTermStructure>& discount)
>
> Now if you want to create a swap index, you have to pass two forward
> curves even though you're only going to use one.
>
> Moreover:
>
> > Add two data members (private) to EuriborSwap
> >                   Handle<YieldTermStructure> fdw6M_;        
> >              Handle<YieldTermStructure> fdw3M_;
> >
> > Add one data member (protected) in swapIndex
> >
> >              Handle<YieldTermStructure> discount_;        
> >
> > EurLiborSwap::create(const Period& tenor) const {
> >     return boost::shared_ptr<SwapIndex>(
> >                    new EurLiborSwap(tenor, fdw6M_, fdw3M_, discount_);
>
> It's three more data members and one method, now. Do we want to add the
> baggage to SwapIndex, or do we leave SwapIndex alone and create a
> separate factory class?
>

EuriborSwap is already a 'Factory', it create a 'SwapIndex' according to tenor.
The tenor decide which one of two 'IborIndex' (and the associated forward curves) to use.

Adding the discount curve (one data member) to 'SwapIndex' is consistent with IborIndex
with forecast curve. So I am in agreement with Nando here.
I think it's nothing wrong to add data members to sub type like EuriborSwap.

To Nando:

If you just want to create a SwapIndex with one Euribor and assocated forecast curve, why don't  
you just use constructor of SwapIndex. So I am questioning why you need the following two constructor?

So the key is whether you guys agree that EuriborSwap is already a 'Factory'.


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EuriborSwap(const Period& tenor,
            const Handle<YieldTermStructure>& fdw =
                                    Handle<YieldTermStructure>(),
            const Handle<YieldTermStructure>& discount =
                                    Handle<YieldTermStructure>());


This preserves backward compatibility while allowing for discounting curve. Plus I would add a new constructor


EuriborSwap(const Period& tenor,
            const boost::shared_ptr<Euribor>& euribor,
            const Handle<YieldTermStructure>& discount =
                                    Handle<YieldTermStructure>());





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