Re: QuantlibXL Variance Surface

Posted by Ferdinando M. Ametrano-3 on
URL: http://quantlib.414.s1.nabble.com/QuantlibXL-Variance-Surface-tp7032p7033.html

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

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users