Re: Making SpreadCdsHelper available in QuantLibXL

Posted by Bhavna J on
URL: http://quantlib.414.s1.nabble.com/Making-SpreadCdsHelper-available-in-QuantLibXL-tp7131p7143.html

Hi All,

Is there a way to view the CDS cashflows in quantlib? For example when pricing a 2 year CDS with semiannual payment frequency, if I want to view the cashflows and hazard rates etc every 6 months, is there any function available for that currently?

Thanks,
Bhavna

Jose Aparicio-Navarro wrote
Easy, you already have everything but the member itself.
Declare the metacode in gensrc\metadata\functions\credit.xml :
------------------------------------------
<Member name='qlDefaultProbability' type='QuantLib::DefaultProbabilityTermStructure' superType='libraryTermStructure'> 
<description>Returns the default probability from the curve reference date to a future date.</description> 
<libraryFunction>defaultProbability</libraryFunction> 
<SupportedPlatforms> 
<SupportedPlatform name='Excel'/> 
</SupportedPlatforms> 
<ParameterList> 
<Parameters> 
<Parameter name='ProbDate' default='QuantLib::Date()'> 
<type>QuantLib::Date</type> 
<tensorRank>scalar</tensorRank> 
<description>future date of the desired probability.</description> 
</Parameter> 
<Parameter name='Extrapolate' default='true'> 
<type>bool</type> 
<tensorRank>scalar</tensorRank> 
<description>FALSE to disable extrapolation beyond the largest date.</description> 
</Parameter> 
</Parameters> 
</ParameterList> 
<ReturnValue> 
<type>QuantLib::Real</type> 
<tensorRank>scalar</tensorRank> 
</ReturnValue> 
</Member> 

------------------------------------------

-Invoke Python magic.
-Recompile.

You'll need to create the objects (helpers and Default TS curve) the whole chain needs.

Best regards
Pepe


----- "Bhavna Jhunjhunwala" <bhavnarpj@gmail.com> a écrit :
> Hi,
>
> Also, would you know what would I need to do in order to expose the CDS.cpp example to quantlibXL? I was trying to get the survival probability given cds spread, but do not find any function for that in excel.
>
> Thanks,
> Bhavna
>
>
> On Mon, Sep 5, 2011 at 1:13 PM, < japari@free.fr > wrote:
>

Hi,
> Nando fixed this recently. See rev. 17927
>
> http://quantlib.svn.sourceforge.net/viewvc/quantlib/trunk/QuantLibXL/qlxl/?view=log 
>
> Best
> pp
>
> ----- "Bhavna J" < bhavnarpj@gmail.com > a écrit :
>
> > Hi,
> >
> > Did you find a workaround for below issue? I am facing same problem
> > and I
> > did build quantlibaddin from source code.
> > I do see the files in the locations as specified here:
> > http://quantlib.org/quantlibaddin/extend_tutorial.html 
> >
> > But, still when I use the add-in I do not see the qlSpreadCdsHelper
> > function
> > in excel.
> > I am using QL1.1 and VS2008.
> >
> > Any help will be appreciated!!
> >
> > Thanks,
> > Bhavna
> >
> >
> > Donald Stewart-2 wrote:
> > >
> > > Hi there,
> > > I'm wanting to use the QuantLib functions in Excel to bootstrap
> > Survival
> > > or Default Probabilities from market observed CDS spreads.
> > > As best I can tell I need to call in Excel something like
> > > qlSreadCdsHelper() but such a function doesn't appear to have been
> > > migrated through to the QuantLibXL layer.
> > > I've compiled the QuantLibXL(0.9.7)/QuantLib(1.0.0) stack under
> > Visual
> > > C++ 2008 (Express Edition). I can see in the QuantLib layer
> > > QuantLib::SpreadCdsHelper and related classes and have seen these
> > used
> > > in the QuantLib C++ example CDS.cpp.
> > > I've tried to migrate QuantLib::SpreadCdsHelper through to the
> > > QuantLibAddin layer following the approached used by
> > DepositRateHelper
> > > but I'm getting compilation errors so am clearly doing something
> > wrong.
> > >
> > > Does anybody on the mailing list have examples/documentation on how
> > to
> > > make functionality in the QuantLib layer available in QuantLibXl ?
> > >
> > > I'd much appreciate some help in resolving this.
> > >
> > > Thanks
> > >
> > > Regards Don Stewart
> > > don.stewart@fsa.gov.uk
> > >
> > >
> > >
> > >
> > >
> > > This communication and any attachments contains information which
> > is
> > > confidential and may be subject to legal privilege. It is for
> > intended
> > > recipients only. If you are not the intended recipient you must not
> > copy,
> > > distribute, publish, rely on or otherwise use it without our
> > consent. Some
> > > of our communications may contain confidential information which it
> > could
> > > be a criminal offence for you to disclose or use without authority.
> > If you
> > > have received this email in error please notify
> > postmaster@fsa.gov.uk
> > > immediately and delete the email from your computer.
> > > The FSA reserves the right to monitor all email communications for
> > > compliance with legal, regulatory and professional standards.
> > > This email is not intended to nor should it be taken to create any
> > legal
> > > relations or contractual relationships. This email has originated
> > from
> > > The Financial Services Authority (FSA)
> > > 25 The North Colonnade,
> > > Canary Wharf,
> > > London
> > > E14 5HS
> > > United Kingdom
> > > Registered as a Limited Company in England and Wales No.1920623.
> > > Registered Office as above
> > > Switchboard: 020 7066 1000
> > > Web Site: http://www.fsa.gov.uk 
> > > *****************************************************************
> > >
> > >
> > >
> > ------------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > QuantLib-users mailing list
> > > QuantLib-users@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/quantlib-users 
> > >
> > >
> >
> > --
> > View this message in context:
> > http://old.nabble.com/Making-SpreadCdsHelper-available-in-QuantLibXL-tp28386117p32386085.html 
> > Sent from the quantlib-users mailing list archive at Nabble.com.
> >
> >
> > ------------------------------------------------------------------------------
> > Special Offer -- Download ArcSight Logger for FREE!
> > Finally, a world-class log management solution at an even better
> > price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> > download Logger. Secure your free ArcSight Logger TODAY!
> > http://p.sf.net/sfu/arcsisghtdev2dev 
> > _______________________________________________
> > QuantLib-users mailing list
> > QuantLib-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/quantlib-users 
>
>
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
QuantLib-users mailing list
QuantLib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users