Re: shortSwapIndexBase in SwaptionVolCube2 (AUD as example)

Posted by Ferdinando M. Ametrano on
URL: http://quantlib.414.s1.nabble.com/reference-of-boost-shared-ptr-instead-of-Handle-tp7623p7649.html

On Thu, Sep 17, 2009 at 10:40 AM, Luigi Ballabio <[hidden email]> wrote:
> Do we want to add the
> baggage to SwapIndex, or do we leave SwapIndex alone and create a
> separate factory class?

I already proposed the latter. Let me revisit my proposal which is backward compatible and incremental.

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>());


which makes a lot more sense to me in the current market, as it makes evident the forwarding role being delegated to the Euribor index while the swap index is mainly concerned about discounting. This addition would also allow for a quick way to handle non-standard swaps, e.g. 10Y fix rate vs 3M Euribor

Then the factory

EuriborSwapFactory(const Handle<Euribor>& euribor6M,
                   const Handle<Euribor>& euribor3M,
                   const Handle<YieldTermStructure>& discount =
                                    Handle<YieldTermStructure>());

EuriborSwapFactory(const Handle<YieldTermStructure>& fdw6M,
                   const Handle<YieldTermStructure>& fdw3M,
                   const Handle<YieldTermStructure>& discount =
                                    Handle<YieldTermStructure>());

boost::shared_ptr<EuriborSwapFactory> create(const Period& tenor,
                                             const Handle<Euribor>& euribor =
                                                 Handle<Euribor>(),

                                             const Handle<YieldTermStructure>& discount =
                                                 Handle<YieldTermStructure>()) const;

most of the code could be even templetized at the SwapIndex level, but I would leave this for a second step.

Any feedback?

--
RSS feed: http://www.google.com/reader/shared/ferdinando.ametrano


------------------------------------------------------------------------------
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