Posted by
Yan Kuang on
URL: http://quantlib.414.s1.nabble.com/reference-of-boost-shared-ptr-instead-of-Handle-tp7623p7633.html
Hi All,
In the constructor of SwaptionVolCube2,
there are two swap index:
const
boost::shared_ptr<SwapIndex>& swapIndexBase,
const
boost::shared_ptr<SwapIndex>& shortSwapIndexBase,
I can't understand why we need two swap
indices. I can only guess different swap tenor may require
different index. However one can always
fix the issue in the index definition. For example I defined
aud BBSW swap index as: (if swap tenor
longer thant 3 years, 6 months tenor for fixed an floating side.)
namespace QuantLib {
AudBbswSwapAfma::AudBbswSwapAfma(const
Period& tenor,
const
Handle<YieldTermStructure>& h)
: SwapIndex("AudBbswSwapAfma",
// familyName
tenor,
1, // settlementDays
AUDCurrency(),
Australia(),
tenor > 3*Years ? 6*Months : 3*Months, //
fixedLegTenor
ModifiedFollowing, // fixedLegConvention
Actual365Fixed(), // fixedLegDaycounter
boost::shared_ptr<IborIndex>
(new
AudBbsw(tenor > 3*Years ? 6*Months : 3*Months, h))) {}
}
To make my SwaptionVolCube2 usage code
compiled, I did the following (4 year for longer, 3 years for shorter :))
swapIndexBase
= boost::shared_ptr<SwapIndex>(new
AudBbswSwapAfma(4*Years, termStructure));
shortSwapIndexBase = boost::shared_ptr<SwapIndex>(new
AudBbswSwapAfma(3*Years, termStructure));
boost::shared_ptr<SwaptionVolCube2> pSwopVolCube(new
SwaptionVolCube2(atmVolMatrix,
tenors.options,
tenors.swaps,
strikeSpreads,
volSpreadsHandle,
swapIndexBase,
shortSwapIndexBase,
vegaWeighedSmileFit));
Please tell me if I missunderstood the
issue. Help will be greatly appreciated, as I am trying to achieve
the target using quantlib under time
pressure.
Many thanks,
Yan
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.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
http://p.sf.net/sfu/bobj-july_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users