Re: QuantlibXL Variance Surface

Posted by Kasakow, Timofej on
URL: http://quantlib.414.s1.nabble.com/QuantlibXL-Variance-Surface-tp7032p7034.html

Hey guys,
 
thanks a lot for your time.
 
@nando
>not exactly. Since the class is already exported (using C++ glue code) its interface can be exported just declaring it in >an xml file
 
Does that mean I will have to build the source using the new interface definitions in the .xml file? I tried to understand the compilation instructions on the QuantLib AddIn homepage, but there is only a note about the possibility of customizing the build with xml metadata by re-running gensrc, but there is nothing about how.
 
Thanks in advance
Timofej
 

Von: [hidden email] [[hidden email]] im Auftrag von Ferdinando Ametrano [[hidden email]]
Gesendet: Freitag, 22. Januar 2010 18:20
An: Kasakow, Timofej
Cc: [hidden email]
Betreff: Re: [Quantlib-users] QuantlibXL Variance Surface

On Tue, Jan 5, 2010 at 1:24 PM, Kasakow, Timofej <[hidden email]> wrote:
> I got an assignment to build an Excel Tool, based on functions
> in QuantlibXL to create and evaluate a Variance Surface. I succeeded
> to create an object of a class BlackVarianceSurface, but I don't know, how
> to move on. I read all of the documentation to QLXL and found no function,
> which uses such an object for input. I suspect this is because the
> functionality of QLXL is limited and the functions using this objects are
> not yet implemented.
You're right, that class constructor has been exported to Excel, but not its base class interface. So it's never been used or documented...

I cleaned up some improper QuantLibAddin inheritance for TermStructure derived classes in http://quantlib.svn.sourceforge.net/viewvc/quantlib?view=rev&revision=17027, and then in http://quantlib.svn.sourceforge.net/viewvc/quantlib?view=rev&revision=17028 I exported BlackVolTermStructure interface and added an example workbook.

The example workbook uses BlackConstantVol, but this is not an issue: BlackVarianceSurface is a sister class (they both derive from BlackVolTermStructure) and you have been already able to create a BlackVarianceSurface object

> I am new to QuantlibXL and honestly have not too much idea about C++
> programming. [...] could you maybe give me some advice, how
> to evaluate the BlackVarianceSurface object. If I am right, does that mean,
> that I need to write a C++ function using functionality of QuantLib and add
> it to the source of QLXL and build it? I appreciate any help.

not exactly. Since the class is already exported (using C++ glue code) its interface can be exported just declaring it in an xml file, e.g.:

   <Member name='qlBlackVolTermStructureBlackVariance' type='QuantLib::BlackVolTermStructure' superType='libraryClass'>
     <description>Returns the black spot variance at a given option date and strike.</description>
     <libraryFunction>blackVariance</libraryFunction>
     <SupportedPlatforms>
       <SupportedPlatform name='Excel'/>
     </SupportedPlatforms>
     <ParameterList>
       <Parameters>
         <Parameter name='OptionDate' exampleValue = '1Y'>
           <type>QuantLib::Date</type>
           <tensorRank>scalar</tensorRank>
           <description>The date at which the variance is evaluated.</description>
         </Parameter>
         <Parameter name='Strike' exampleValue = '5%'>
           <type>QuantLib::Real</type>
           <tensorRank>scalar</tensorRank>
           <description>The strike at which the variance is evaluated.</description>
         </Parameter>
         <Parameter name='AllowExtrapolation' const='False' default='false'>
           <type>bool</type>
           <tensorRank>scalar</tensorRank>
           <description>Extrapolation Flag (TRUE allows extrapolation).</description>
         </Parameter>
       </Parameters>
     </ParameterList>
     <ReturnValue>
       <type>QuantLib::Real</type>
       <tensorRank>scalar</tensorRank>
     </ReturnValue>
   </Member>

ciao -- Nando

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users