STK_ForwardStartOption





http://www.QuantTools.com
CapeTools Stock Option Portfolio function list

Welcome | Documentation format | QuantTools Groups | QuantTools Categories | Licence

Key TAGs | Excel Index | API Index



Starts at the money or proportionally in or out of the money after a known elapsed time into the future.

If alpha is less than 1, the call (put) will start (1-alpha) percent in the money (out of the money), if alpha is 1, the option will start at the money, and if alpha is larger than 1, the call (put) will start alpha-1 percent out of the money (in the money).

This function utilizes an analytical (closed-form) algorithm.

Note that the risk (greek) numbers produced are the mathematically defined equivalent of a derivative (instantaneous change).

You can convert the risk number to your own definition of risk by multiplying by the shift you require.

For example, for a typical definition of VANNA, (change in underlying and volatility), where one defines the change in the underlying as a single unit of change (1.0) and the change in volatility as a one percent change (0.01), simply multiply the VANNA result calculated by (1.0*0.01).

For VEGA, change in volatility of one percent (0.01), simply multiply the VEGA result by 0.01. Within option contracts THETA is negative, however the mathematically defined equivalent of THETA (instantaneous FORWARD change in time) is positive.

Internally we have negated this value for you.

To express THETA as THETA per day, simply multiply the THETA result by 1/365 or 1/252 (depending on whether you require calendar days or business days).

This function stores a portfolio of options (where the underlying does not have dividend payments) in memory and returns a key.

This allows you to price or query the portfolio for different value dates via just the portfolio key.

You can price the portfolio via the PriceOptionBook() function.

You can view the trades within the portfolio via the DisplayOptionBook() function.

The DisplayOptionBook() function allows you to sort the portfolio using any column (or combination of columns).

A column is simply the NAME of any of the parameters within this function (excluding the 'TradeKey' and 'Reload' parameters).

In addition you can create a new portfolio object from this object by grouping trades within the portfolio, for example by Currency, Units, Sector etc..., using the GroupOptionBook() function.

You simply provide the NAME of the parameters that you wish to group.

Groups can represent more than one column and thus enables you to price a portion of the portfolio (a group) using the same PriceOptionBook() function.

You can view the grouped names within the grouped portfolio via the DisplayOptionGroups() function.

You can view the trades within a group via the DisplayGRPOptionBook() function.

Furthermore you can create a new portfolio from this portfolio object by selecting a portion of the trades (via a sql-like language).

Again this portfolio can be priced via the PriceOptionBook() function.

You can also execute the WriteXLRange(), WriteXLRange2() or WriteXLRange3() and the corresponding ReadXLRange(), ReadXLRange2() or ReadXLRange3() functions in order to read and write the portfolio data to file (XML).

WriteXLRange2() is preferable as you can save each of the ranges of this function to different slots (total of 15) within the XML file.



This function creates an object and returns a string-key value to represent this created object.
The TAG value of the string-key returned (second part of the key) is : "STK_ForwardStartOption"



Note: Within Excel, the function is named - CT.STK_ForwardStartOption




High level graphic of STK_ForwardStartOption() function with parameters. Blue square node is the actual function with the parameters ordered.



Parameter Description


  1. TradeKey parameter

    User Handle used to retrieve the object
  2. Reload parameter

    When creating this object for the first time, set this parameter to a positive value. Within Excel, when recomputing a worksheet where you do not wish to recreate the object, set this parameter to zero (0).
  3. ID parameter

    Identifier of deal. Used in order to index within the portfolio.
  4. TAG parameter

    User defined Tag. The information within this column can be used within the 'CapeTools Select Sub-Portfolios' or 'CapeTools Group Sub-Portfolios' categories of functions.
  5. Ccy parameter

    Currency of the portfolio.
  6. Units parameter

    Number of option contracts you wish to trade in (positive value).
  7. Position parameter

    Whether you are long or short the option.
  8. CallPut parameter

    Option Types (C)all or (P)ut
  9. Underlying parameter

    Underlying price, curve
  10. Alpha parameter

    Factor indicating how in or out of the money the option will start.
  11. Time1 parameter

    The time at which the strike is set equal to a positive constant alpha, times the asset price, S.
  12. TimeT parameter

    Time to maturity of the option.
  13. Rate parameter

    For the underlying (equity, futures, FX or commodity), this should be an annualised rate (risk free rate or foreign rate). If this is an option on a FX underlying, then if the underlying is quoted as domestic/foreign then this rate will be the domestic rate. If, however, the FX underlying is quoted as foreign/domestic then this will be the foreign rate.
  14. Vol parameter

    Volatility of the underlying.


Extended information

Function Syntax

VB Syntax


String CTStockOptionPortfolio.STK_ForwardStartOption( _
String TradeKey, _
Long Reload, _
Variant ID, _
Variant TAG, _
Variant Ccy, _
Variant Units, _
Variant Position, _
Variant CallPut, _
Variant Underlying, _
Variant Alpha, _
Variant Time1, _
Variant TimeT, _
Variant Rate, _
Variant Vol)


Excel Spreadsheet Syntax


=CT.STK_ForwardStartOption(
Excel String Cell TradeKey,
Excel Numeric Cell Reload,
XLRange ID,
XLRange TAG,
XLRange Ccy,
XLRange Units,
XLRange Position,
XLRange CallPut,
XLRange Underlying,
XLRange Alpha,
XLRange Time1,
XLRange TimeT,
XLRange Rate,
XLRange Vol)


C++ Syntax


static std::string STK_ForwardStartOption(
std::string TradeKey,
long Reload,
CTRangeDataCPP ID,
CTRangeDataCPP TAG,
CTRangeDataCPP Ccy,
CTRangeDataCPP Units,
CTRangeDataCPP Position,
CTRangeDataCPP CallPut,
CTRangeDataCPP Underlying,
CTRangeDataCPP Alpha,
CTRangeDataCPP Time1,
CTRangeDataCPP TimeT,
CTRangeDataCPP Rate,
CTRangeDataCPP Vol);


DotNET Syntax


System.String CTStockOptionPortfolioSA.STK_ForwardStartOption(
System.String TradeKey,
System.Int32 Reload,
CTRangeData ID,
CTRangeData TAG,
CTRangeData Ccy,
CTRangeData Units,
CTRangeData Position,
CTRangeData CallPut,
CTRangeData Underlying,
CTRangeData Alpha,
CTRangeData Time1,
CTRangeData TimeT,
CTRangeData Rate,
CTRangeData Vol);

Parameter data types

ArgNameArgTypeIsKey
TradeKeyStringFALSE
ReloadLongFALSE
IDRangeFALSE
TAGRangeFALSE
CcyRangeFALSE
UnitsRangeFALSE
PositionRangeFALSE
CallPutRangeFALSE
UnderlyingRangeFALSE
AlphaRangeFALSE
Time1RangeFALSE
TimeTRangeFALSE
RateRangeFALSE
VolRangeFALSE


Example Inputs

The first column represents the name of the parameters. The second column specifies whether the parameters are optional or not. Finally the last column provides some sample input data.
Function call input string-keys are always in the format : "NAME.EXTTAG.TICKER" The "EXTTAG.TICKER" part is determined from the output of other, capetools, object creation functions.


ArgNameIsOptional (Excel only)Example
TradeKeyFALSEMySTK_ForwardStartOptionDeal
ReloadFALSE1
IDFALSESTK_ForwardStartOption_ID_Range (creates a range object)
TAGFALSESTK_ForwardStartOption_TAG_Range (creates a range object)
CcyFALSESTK_ForwardStartOption_Ccy_Range (creates a range object)
UnitsFALSESTK_ForwardStartOption_Units_Range (creates a range object)
PositionFALSESTK_ForwardStartOption_Position_Range (creates a range object)
CallPutFALSESTK_ForwardStartOption_CallPut_Range (creates a range object)
UnderlyingFALSESTK_ForwardStartOption_Underlying_Range (creates a range object)
AlphaFALSESTK_ForwardStartOption_Alpha_Range (creates a range object)
Time1FALSESTK_ForwardStartOption_Time1_Range (creates a range object)
TimeTFALSESTK_ForwardStartOption_TimeT_Range (creates a range object)
RateFALSESTK_ForwardStartOption_Rate_Range (creates a range object)
VolFALSESTK_ForwardStartOption_Vol_Range (creates a range object)


Example range for parameter : ID

Within Excel, a range such as this can be passed directly into the ID parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : ID



CTQL.CTRangeData STK_ForwardStartOption_ID;


string[] arrBSTK_ForwardStartOption_ID = {
"DEAL-11",
"DEAL-12",
"DEAL-13",
"DEAL-14",
"DEAL-15",
"DEAL-16",
"DEAL-17",
"DEAL-18",
"DEAL-19",
"DEAL-20",
"DEAL-21",
"DEAL-22",
"DEAL-23",
"DEAL-24",
"DEAL-25",
"DEAL-26",
"DEAL-27",
"DEAL-28",
"DEAL-29",
"DEAL-30"  //  Array Data

};

CTQL.StringVector arrSTK_ForwardStartOption_ID =
new  CTQL.StringVector(arrBSTK_ForwardStartOption_ID);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_ForwardStartOption_ID = new  CTQL.CTRangeData(arrSTK_ForwardStartOption_ID, false);


Example range for parameter : TAG

Within Excel, a range such as this can be passed directly into the TAG parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : TAG



CTQL.CTRangeData STK_ForwardStartOption_TAG;


string[] arrBSTK_ForwardStartOption_TAG = {
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG1",
"TAG2",
"TAG2",
"TAG2",
"TAG2",
"TAG2",
"TAG2",
"TAG2",
"TAG2",
"TAG2",
"TAG2"  //  Array Data

};

CTQL.StringVector arrSTK_ForwardStartOption_TAG =
new  CTQL.StringVector(arrBSTK_ForwardStartOption_TAG);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_ForwardStartOption_TAG = new  CTQL.CTRangeData(arrSTK_ForwardStartOption_TAG, false);


Example range for parameter : Ccy

Within Excel, a range such as this can be passed directly into the Ccy parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Ccy



CTQL.CTRangeData STK_ForwardStartOption_Ccy;


string[] arrBSTK_ForwardStartOption_Ccy = {
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"EUR",
"GBP",
"GBP"  //  Array Data

};

CTQL.StringVector arrSTK_ForwardStartOption_Ccy =
new  CTQL.StringVector(arrBSTK_ForwardStartOption_Ccy);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_ForwardStartOption_Ccy = new  CTQL.CTRangeData(arrSTK_ForwardStartOption_Ccy, false);


Example range for parameter : Units

Within Excel, a range such as this can be passed directly into the Units parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Units



CTQL.CTRangeData STK_ForwardStartOption_Units;


int[] arrBSTK_ForwardStartOption_Units = {
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1  //  Array Data

};

CTQL.IntVector arrSTK_ForwardStartOption_Units =
new  CTQL.IntVector(arrBSTK_ForwardStartOption_Units);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_ForwardStartOption_Units = new  CTQL.CTRangeData(arrSTK_ForwardStartOption_Units, false);


Example range for parameter : Position

Within Excel, a range such as this can be passed directly into the Position parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Position



CTQL.CTRangeData STK_ForwardStartOption_Position;


string[] arrBSTK_ForwardStartOption_Position = {
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG",
"LONG"  //  Array Data

};

CTQL.StringVector arrSTK_ForwardStartOption_Position =
new  CTQL.StringVector(arrBSTK_ForwardStartOption_Position);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_ForwardStartOption_Position = new  CTQL.CTRangeData(arrSTK_ForwardStartOption_Position, false);


Example range for parameter : CallPut

Within Excel, a range such as this can be passed directly into the CallPut parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : CallPut



CTQL.CTRangeData STK_ForwardStartOption_CallPut;


string[] arrBSTK_ForwardStartOption_CallPut = {
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call",
"Call"  //  Array Data

};

CTQL.StringVector arrSTK_ForwardStartOption_CallPut =
new  CTQL.StringVector(arrBSTK_ForwardStartOption_CallPut);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_ForwardStartOption_CallPut = new  CTQL.CTRangeData(arrSTK_ForwardStartOption_CallPut, false);


Example range for parameter : Underlying

Within Excel, a range such as this can be passed directly into the Underlying parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Underlying



CTQL.CTRangeData STK_ForwardStartOption_Underlying;


int[] arrBSTK_ForwardStartOption_Underlying = {
55,
60,
55,
65,
59,
66,
58,
62,
60,
65,
56,
59,
61,
63,
65,
63,
60,
64,
59,
60  //  Array Data

};

CTQL.IntVector arrSTK_ForwardStartOption_Underlying =
new  CTQL.IntVector(arrBSTK_ForwardStartOption_Underlying);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_ForwardStartOption_Underlying = new  CTQL.CTRangeData(arrSTK_ForwardStartOption_Underlying, false);


Example range for parameter : Alpha

Within Excel, a range such as this can be passed directly into the Alpha parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Alpha



CTQL.CTRangeData STK_ForwardStartOption_Alpha;


double[] arrBSTK_ForwardStartOption_Alpha = {
1.0112,
1.0225,
1.1279,
1.1495,
1.1031,
1.1738,
1.2084,
1.1204,
1.0476,
1.163,
1.1672,
1.0793,
1.0603,
1.0724,
0.9918,
1.0222,
1.0561,
1.0057,
1.0446,
1.1  //  Array Data

};

CTQL.DoubleVector arrSTK_ForwardStartOption_Alpha =
new  CTQL.DoubleVector(arrBSTK_ForwardStartOption_Alpha);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_ForwardStartOption_Alpha = new  CTQL.CTRangeData(arrSTK_ForwardStartOption_Alpha, false);


Example range for parameter : Time1

Within Excel, a range such as this can be passed directly into the Time1 parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Time1



CTQL.CTRangeData STK_ForwardStartOption_Time1;


int[] arrBSTK_ForwardStartOption_Time1 = {
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy"),
CTQL.Date.serialNumber("18/10/2005", "dd/mm/yyyy")  //  Array Data

};

CTQL.IntVector arrSTK_ForwardStartOption_Time1 =
new  CTQL.IntVector(arrBSTK_ForwardStartOption_Time1);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_ForwardStartOption_Time1 = new  CTQL.CTRangeData(arrSTK_ForwardStartOption_Time1, false);


Example range for parameter : TimeT

Within Excel, a range such as this can be passed directly into the TimeT parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : TimeT



CTQL.CTRangeData STK_ForwardStartOption_TimeT;


int[] arrBSTK_ForwardStartOption_TimeT = {
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("19/7/2006", "dd/mm/yyyy")  //  Array Data

};

CTQL.IntVector arrSTK_ForwardStartOption_TimeT =
new  CTQL.IntVector(arrBSTK_ForwardStartOption_TimeT);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_ForwardStartOption_TimeT = new  CTQL.CTRangeData(arrSTK_ForwardStartOption_TimeT, false);


Example range for parameter : Rate

Within Excel, a range such as this can be passed directly into the Rate parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Rate



CTQL.CTRangeData STK_ForwardStartOption_Rate;


double[] arrBSTK_ForwardStartOption_Rate = {
0.0824,
0.0814,
0.0853,
0.0738,
0.0826,
0.0807,
0.0759,
0.0764,
0.0757,
0.0864,
0.0755,
0.0796,
0.0795,
0.0864,
0.0771,
0.074,
0.0876,
0.077,
0.0809,
0.08  //  Array Data

};

CTQL.DoubleVector arrSTK_ForwardStartOption_Rate =
new  CTQL.DoubleVector(arrBSTK_ForwardStartOption_Rate);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_ForwardStartOption_Rate = new  CTQL.CTRangeData(arrSTK_ForwardStartOption_Rate, false);


Example range for parameter : Vol

Within Excel, a range such as this can be passed directly into the Vol parameter.


Data is stored within the second column (Vector of data)..

Example C# API usage for setting the range data for parameter : Vol



CTQL.CTRangeData STK_ForwardStartOption_Vol;


double[] arrBSTK_ForwardStartOption_Vol = {
0.2958,
0.3097,
0.2949,
0.3151,
0.2784,
0.2829,
0.3278,
0.3141,
0.3033,
0.2772,
0.2721,
0.2939,
0.28,
0.3134,
0.2796,
0.2986,
0.3204,
0.2845,
0.2847,
0.3  //  Array Data

};

CTQL.DoubleVector arrSTK_ForwardStartOption_Vol =
new  CTQL.DoubleVector(arrBSTK_ForwardStartOption_Vol);

// Second parameter determines whether the array is a column array (false) or a row array (true)
STK_ForwardStartOption_Vol = new  CTQL.CTRangeData(arrSTK_ForwardStartOption_Vol, false);



Example function usage


The C# example below contains all the sub-function calls leading up to this function call. As a result, the example can contain a lot of code.

The VB.NET, J#, C++.NET, Java, Excel VBA, Visual Basic 6 (via COM) and C++ examples below contain function code stubs for the calls leading up to this function call. However, the function call for this function is displayed.
You can easily reproduce the stub functions code from the C# example.


If you are accessing this functrion via the MiniXL libraries, this function is present within the CT.QL.OptionPortfolios20 MiniXL Excel Addin.

Within our Excel Example Addin Generator, we have used the following QuantTools sub-functions in order to prepare the arguments needed to call the STK_ForwardStartOption() function. If you are executing this function via the MiniXL libraries, the module addin name, (in brackets, to the right of the sub-functions listed below), indicates the MiniXL library in which the sub-function is held. You will need to load this library into your Excel session (along with any other libraries that the sub-function call within the addin requires (ie - CT.QT.Utils20 addin in almost all cases) in order for the example to compute successfully.


The following four examples demostrate calling this function within a Microsoft .NET environment

The following four examples demostrate calling this function within a non .NET environment

The following is a sample output from executing the STK_ForwardStartOption() function call


MySTK_ForwardStartOptionDeal_7.STK_ForwardStartOption.0

Copyright (c) 2003-2007 CapeTools - All Rights Reserved.