XLL+ Class Library

LabelledArgs Sample

Overview

This simple add-in contains a calculator for calculating the value and derivatives of a vanilla option, and is a simpler version of the function in the SimpOpt sample.

The BSValue2 function expects its arguments to be in two groups: RefArgs (which are the same for all options on the same underlying security) and StdArgs (which vary for each option). Each group of arguments is expected to be either in an ordered vector, or in a labelled two-column array.

The labelled layout is very flexible, and can also offer improved transparency to the user. Using labelled groups, the user can lay out arguments to suit their own purposes, rather than to suit the requirements of a particular calculator function. This is especially useful when different functions have different requirements for the order of arguments.

Features

The sample displays the following features:

Implementation

The following steps were significant in creating and completing the SimpOpt application.

  1. Pre-cooked header and source files were added to the project, containing code for the business functions.
  2. The XLL+ Function Wizard was used to group the arguments and the wizard generated all the code required to unpack the values from the arrays passed by Excel.

Notes

The demonstration workbook, LabelledArgs.xls, shows how to use labelled arguments with the TFOLDT worksheet function for simple and powerful manipulation of large arrays of data.

Functions used

CXlOper::Format
CXlOper::Ret

Project files

If you are using MS Developer Studio 6, then you should open the project file LabelledArgs.dsp.

If you are using MS Visual Studio .NET 2002, then you should open the solution file LabelledArgs.sln or the project file LabelledArgs.vcproj.

If you are using MS Visual Studio .NET 2003, then you should open the solution file LabelledArgs71.sln or the project file LabelledArgs71.vcproj.

If you are using MS Visual Studio 2005, then you should open the solution file LabelledArgs8.sln or the project file LabelledArgs8.vcproj.

See Also

List of Sample Projects | Samples and Walkthroughs | SimpOpt sample | TFOLD sample