Creating a Project

Navigation:  Getting Started >

Creating a Project

Previous pageReturn to chapter overviewNext page

 

When you create a project that uses the FinOptions API component, a reference to the FinOptions 3.1 Type Library should be added to it. This library contains classes to price and value over 60 different types of derivative instruments.

 

 

This example, written with C#, shows how to price a vanilla option with the Black-Scholes model.

1.Reference the FinOptions 3.1 Type Library through the Add Reference option off of the Project menu.

ReferenceManager

 

2.Open a file that contains a form's declaration: in C# - a form's declaration can be found in the Form1.cs file, while in Visual Basic - the form is in the Form1.Designer.vb file). The form is declared as follows.

public partial class Form1 : Form {

   //...

}

Partial Class Form1

   Inherits System.Windows.Forms.Form

   '...

End Class

 

 

3.Rewrite this declaration as follows.  Please note that the attributes for the various parameters of the function would not be hard coded as below, this is done for demonstration purposes only.

private void Form1_Load(object sender, EventArgs e)

{

    FinOptionsLib.VanillaOptions options = new FinOptionsLib.VanillaOptions();

double result = options.BlackScholes(

FinOptionsLib.enumExerciseType.European, FinOptionsLib.enumOptionType.CallOption, FinOptionsLib.enumModelStat.Theoretical, 50, 49, .25, .2, .06, 0.0);

}

 

 

4.Then rebuild the project.

 

Object Model Overview

The library is broken down into four Class objects

Class

Description

ExoticOptions

Provides a group of functions for pricing and valuing exotic options and their sensitivities.

VanillaOptions

Provides functions for pricing and valuing vanilla or standard options and their sensitivities.

Registration

Provides access properties to check the registration and register the software.

 

The following properties exist on the Registration object

PropertyImage

AccessLevel

string {get;} Value indicating whether or not the a valid RegistrationKey was set. The possible values are: "Not  Valid License" and "Single User License" if the RegistrationKey is valid

PropertyImage

DaysUntilExpire

int {get;} Property indicating the number of days until the trial period expires.

PropertyImage

EnablesExceptions

boolean {get; set;} Value set indicating whether or not exceptions are raised when there are errors, either due  to validation or otherwise. If disabled (= false) exceptions are raised when an internal error occurs. Exceptions  provides you with a clear explanation for the issue which will guide you to resolving it.

PropertyImage

LastError

FinOptionsLib.enumErrCodes {get;} Object containing an error returned when function throws an exception.

PropertyImage

ProductID

string {get;} The product id generated after a successful registration.

PropertyImage

RegistrationKey

string {get; set;} Value set to register the product.

Utility

Provides utility functions to augment the financial models with functions to calculate historical volatility, interpolate and curve fit data sets.

 

 

See Also

Vanilla Options

Exotic Options

Interest Rate Instruments

Utilities