MBinaryBarrier





http://www.QuantTools.com
CapeTools Exotic Analysis function list

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

Key TAGs | Excel Index | API Index



There are 28 different types of so-called binary options.

The binary barrier options can be divided into two categories.

Cash-or-nothing barrier options.

These either pay out a pre-specified cash amount or nothing, depending on whether the asset price has hit the barrier or not.

The other category is the asset-or-nothing barrier options, which pay out the value of the asset or nothing, depending on whether the asset price has hit the barrier or not.

The 28 different types of options are : TypeFlag=1 implying Down-and-in cash-(at-hit)-or-nothing (S greater than H).

TypeFlag=2 implying Up-and-in cash-(at-hit)-or-nothing (S less than H).

TypeFlag=3 implying Down-and-in asset-(at-hit)-or-nothing (K=H) (S greater than H).

TypeFlag=4 implying Up-and-in asset-(at-hit)-or-nothing (K=H)(S less than H).

TypeFlag=5 implying Down-and-in cash-(at-expiry)-or-nothing (S greater than H).

TypeFlag=6 implying Up-and-in cash-(at-expiry)-or-nothing (S less than H).

TypeFlag=7 implying Down-and-in asset-(at-expiry)-or-nothing (S greater than H).

TypeFlag=8 implying Up-and-in asset-(at-expiry)-or-nothing (S less than H).

TypeFlag=9 implying Down-and-out cash-(at-expiry)-or-nothing (S greater than H).

TypeFlag=10 implying Up-and-out cash-(at-expiry)-or-nothing (S less than H).

TypeFlag=11 implying Down-and-out asset-(at-expiry)-or-nothing (S greater than H).

TypeFlag=12 implying Up-and-out asset-(at-expiry)-or-nothing (S less than H).

TypeFlag=13 implying Down-and-in cash-(at-expiry)-or-nothing call (S greater than H).

TypeFlag=14 implying Up-and-in cash-(at-expiry)-or-nothing call (S less than H).

TypeFlag=15 implying Down-and-in asset-(at-expiry)-or-nothing call (S greater than H).

TypeFlag=16 implying Up-and-in asset-(at-expiry)-or-nothing call (S less than H).

TypeFlag=17 implying Down-and-in cash-(at-expiry)-or-nothing put (S greater than H).

TypeFlag=18 implying Up-and-in cash-(at-expiry)-or-nothing put (S less than H).

TypeFlag=19 implying Down-and-in asset-(at-expiry)-or-nothing put (S greater than H).

TypeFlag=20 implying Up-and-in asset-(at-expiry)-or-nothing put (S less than H).

TypeFlag=21 implying Down-and-out cash-(at-expiry)-or-nothing call (S greater than H).

TypeFlag=22 implying Up-and-out cash-(at-expiry)-or-nothing call (S less than H).

TypeFlag=23 implying Down-and-out asset-(at-expiry)-or-nothing call (S greater than H).

TypeFlag=24 implying Up-and-out asset-(at-expiry)-or-nothing call (S less than H).

TypeFlag=25 implying Down-and-out cash-(at-expiry)-or-nothing put (S greater than H).

TypeFlag=26 implying Up-and-out cash-(at-expiry)-or-nothing put (S less than H).

TypeFlag=27 implying Down-and-out asset-(at-expiry)-or-nothing put (S greater than H).

TypeFlag=28 implying Up-and-out asset-(at-expiry)-or-nothing put (S less than H).

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 prices a portfolio of equity, commodities, futures or FX option deals from raw inputs.

All memory is discarded once the computation is finished.

You can request for all first and second order risk statistics simply by filling in the greek field with the name of the parameter.

The name of the parameter must be proceeded with the character 'd'. Thus if 'Stock', 'Time' and 'Vol' are the names of three parameters which represent underlying price, Option Maturity and option volatility respectively, you can request DELTA as 'dStock', GAMMA as 'dStockdStock' (dStock twice), VEGA as 'dVol', THETA as 'dTime', VOLGA as 'dVoldVol' (dVol twice) and VANNA (cross-derivative) as 'dStockdVol' or 'dVoldStock'. You can also, if you wish request 'dTimedVol' (second derivative with respect to Time and Vol).

If you wish to view all the second order derivatives within a matrix, please refer to the CapeTools Derivative Matrix category of functions.

This logic can be applied to any parameter which is of a double-valued type (decimal value).

The risk statistics are the partial derivatives with respect to the option price, thus you can scale the results by multiplying by a factor.

For example, to compute the VEGA for a one percent change in volatility (0.01), simply multiply the VEGA result by 0.01. To compute THETA for a one day change (1/365), multiply the THETA result by 1/365. To compute the DELTA for a one-unit change (1), multiply the delta by 1 which is, of course the same result as the original delta.

For second order risks, simply multiply by the product of the changes.



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




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



Parameter Description


  1. ValueDate parameter

    Valuation Date (typically equal to Today's date)
  2. dayCounter parameter

    For any input parameter within this function that represents a dividend rate, risk free rate, foreign rate or holding cost rate, these rates will be defined as annually compounded using the DayCounter defined within this parameter. Thus if 'actual365' is used for this 'dayCounter' parameter, then all input parameters that represent a dividend, risk free, foreign or holding cost rates will be defined as annually compounded Actual365 rates.
  3. Units parameter

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

    Whether you are long or short the option.
  5. Level parameter

    Whether you would like to view the PV for the entire structure/portfolio 'TOTAL'. Whether you would like to view the PV for each option 'CASHFLOW'. Or whether you would like to view the PV and extended information, 'ALL'. Thus valid values are - 'TOTAL', 'CASHFLOW' or 'ALL'.
  6. TypeFlag parameter

    Integer value (1 - 28) indicating option type.
  7. S parameter

    Underlying price
  8. X parameter

    Strike price of the option
  9. H parameter

    Continuous Barrier level
  10. AdjBarrFreq parameter

    Monitoring frequency that you wish the continuous barrier level value entered to have. (Basically will convert the barrier from continuous to discrete. If you choose 'Continuously', the barrier will still be a Continuous barrier). Valid values are : Continuously, Hourly, Daily, Weekly or Monthly.
  11. K parameter

    Cash value to be paid.
  12. T parameter

    Time to option maturity.
  13. r 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. b parameter

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

    Volatility of the underlying.
  16. Greek parameter

    For the option premium specify 'PREMIUM'. For all first derivatives, you can specify one of the following : 'dS' (for the 'S' parameter), 'dX' (for the 'X' parameter), 'dH' (for the 'H' parameter), 'dK' (for the 'K' parameter), 'dT' (for the 'T' parameter), 'dr' (for the 'r' parameter), 'db' (for the 'b' parameter), 'dv' (for the 'v' parameter), For second order derivatives, you can specify combinations of the first order derivatives (i.e. - 'dSdS', 'dvdv', 'dSdv'. )


Extended information

Function Syntax

VB Syntax


Variant CTExoticAnalysis.MBinaryBarrier( _
Long ValueDate, _
DayCountEnum dayCounter, _
Variant Units, _
Variant Position, _
String Level, _
Variant TypeFlag, _
Variant S, _
Variant X, _
Variant H, _
Variant AdjBarrFreq, _
Variant K, _
Variant T, _
Variant r, _
Variant b, _
Variant v, _
String Greek)


Excel Spreadsheet Syntax


=CT.MBinaryBarrier(
Excel Numeric Cell ValueDate,
Excel String Cell dayCounter,
XLRange Units,
XLRange Position,
Excel String Cell Level,
XLRange TypeFlag,
XLRange S,
XLRange X,
XLRange H,
XLRange AdjBarrFreq,
XLRange K,
XLRange T,
XLRange r,
XLRange b,
XLRange v,
Excel String Cell Greek)


C++ Syntax


static CTRangeDataCPP MBinaryBarrier(
long ValueDate,
DayCountEnum dayCounter,
CTRangeDataCPP Units,
CTRangeDataCPP Position,
std::string Level,
CTRangeDataCPP TypeFlag,
CTRangeDataCPP S,
CTRangeDataCPP X,
CTRangeDataCPP H,
CTRangeDataCPP AdjBarrFreq,
CTRangeDataCPP K,
CTRangeDataCPP T,
CTRangeDataCPP r,
CTRangeDataCPP b,
CTRangeDataCPP v,
std::string Greek);


DotNET Syntax


CTRangeData CTExoticAnalysisSA.MBinaryBarrier(
System.Int32 ValueDate,
CTIEnums.DayCountEnum dayCounter,
CTRangeData Units,
CTRangeData Position,
System.String Level,
CTRangeData TypeFlag,
CTRangeData S,
CTRangeData X,
CTRangeData H,
CTRangeData AdjBarrFreq,
CTRangeData K,
CTRangeData T,
CTRangeData r,
CTRangeData b,
CTRangeData v,
System.String Greek);

Parameter data types

ArgNameArgTypeIsKey
ValueDateLongFALSE
dayCounterDayCountEnumFALSE
UnitsRangeFALSE
PositionRangeFALSE
LevelStringFALSE
TypeFlagRangeFALSE
SRangeFALSE
XRangeFALSE
HRangeFALSE
AdjBarrFreqRangeFALSE
KRangeFALSE
TRangeFALSE
rRangeFALSE
bRangeFALSE
vRangeFALSE
GreekStringFALSE


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
ValueDateFALSE19/Jul/2005 (serial date type)
dayCounterFALSEACT365
UnitsFALSEMBinaryBarrier_Units_Range (creates a range object)
PositionFALSEMBinaryBarrier_Position_Range (creates a range object)
LevelFALSEALL
TypeFlagFALSEMBinaryBarrier_TypeFlag_Range (creates a range object)
SFALSEMBinaryBarrier_S_Range (creates a range object)
XFALSEMBinaryBarrier_X_Range (creates a range object)
HFALSEMBinaryBarrier_H_Range (creates a range object)
AdjBarrFreqFALSEMBinaryBarrier_AdjBarrFreq_Range (creates a range object)
KFALSEMBinaryBarrier_K_Range (creates a range object)
TFALSEMBinaryBarrier_T_Range (creates a range object)
rFALSEMBinaryBarrier_r_Range (creates a range object)
bFALSEMBinaryBarrier_b_Range (creates a range object)
vFALSEMBinaryBarrier_v_Range (creates a range object)
GreekFALSEPREMIUM


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 MBinaryBarrier_Units;


int[] arrBMBinaryBarrier_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 arrMBinaryBarrier_Units =
new  CTQL.IntVector(arrBMBinaryBarrier_Units);

// Second parameter determines whether the array is a column array (false) or a row array (true)
MBinaryBarrier_Units = new  CTQL.CTRangeData(arrMBinaryBarrier_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 MBinaryBarrier_Position;


string[] arrBMBinaryBarrier_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 arrMBinaryBarrier_Position =
new  CTQL.StringVector(arrBMBinaryBarrier_Position);

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


Example range for parameter : TypeFlag

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


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

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



CTQL.CTRangeData MBinaryBarrier_TypeFlag;


int[] arrBMBinaryBarrier_TypeFlag = {
10,
11,
10,
11,
10,
10,
11,
11,
10,
10,
11,
12,
10,
11,
12,
12,
12,
11,
10,
11  //  Array Data

};

CTQL.IntVector arrMBinaryBarrier_TypeFlag =
new  CTQL.IntVector(arrBMBinaryBarrier_TypeFlag);

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


Example range for parameter : S

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


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

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



CTQL.CTRangeData MBinaryBarrier_S;


double[] arrBMBinaryBarrier_S = {
115.1575,
99.9977,
94.8882,
97.9211,
113.897,
110.1828,
113.3723,
110.601,
107.7112,
101.429,
100.8175,
101.9637,
109.7776,
109.0162,
104.9469,
98.1528,
100.7279,
97.8618,
111.5704,
105.0  //  Array Data

};

CTQL.DoubleVector arrMBinaryBarrier_S =
new  CTQL.DoubleVector(arrBMBinaryBarrier_S);

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


Example range for parameter : X

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


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

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



CTQL.CTRangeData MBinaryBarrier_X;


int[] arrBMBinaryBarrier_X = {
95,
108,
104,
110,
111,
102,
101,
103,
105,
101,
103,
106,
92,
98,
98,
105,
93,
106,
102,
102  //  Array Data

};

CTQL.IntVector arrMBinaryBarrier_X =
new  CTQL.IntVector(arrBMBinaryBarrier_X);

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


Example range for parameter : H

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


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

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



CTQL.CTRangeData MBinaryBarrier_H;


int[] arrBMBinaryBarrier_H = {
106,
94,
102,
93,
97,
93,
109,
104,
104,
95,
97,
106,
96,
94,
100,
97,
100,
109,
101,
100  //  Array Data

};

CTQL.IntVector arrMBinaryBarrier_H =
new  CTQL.IntVector(arrBMBinaryBarrier_H);

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


Example range for parameter : AdjBarrFreq

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


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

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



CTQL.CTRangeData MBinaryBarrier_AdjBarrFreq;


string[] arrBMBinaryBarrier_AdjBarrFreq = {
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily",
"Daily"  //  Array Data

};

CTQL.StringVector arrMBinaryBarrier_AdjBarrFreq =
new  CTQL.StringVector(arrBMBinaryBarrier_AdjBarrFreq);

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


Example range for parameter : K

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


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

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



CTQL.CTRangeData MBinaryBarrier_K;


int[] arrBMBinaryBarrier_K = {
15,
16,
14,
16,
16,
15,
15,
14,
14,
16,
16,
15,
16,
14,
16,
14,
15,
16,
16,
15  //  Array Data

};

CTQL.IntVector arrMBinaryBarrier_K =
new  CTQL.IntVector(arrBMBinaryBarrier_K);

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


Example range for parameter : T

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


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

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



CTQL.CTRangeData MBinaryBarrier_T;


int[] arrBMBinaryBarrier_T = {
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy"),
CTQL.Date.serialNumber("17/1/2006", "dd/mm/yyyy")  //  Array Data

};

CTQL.IntVector arrMBinaryBarrier_T =
new  CTQL.IntVector(arrBMBinaryBarrier_T);

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


Example range for parameter : r

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


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

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



CTQL.CTRangeData MBinaryBarrier_r;


double[] arrBMBinaryBarrier_r = {
0.1042,
0.0914,
0.0976,
0.0993,
0.1018,
0.1054,
0.0996,
0.1059,
0.1092,
0.107,
0.109,
0.1001,
0.1044,
0.0927,
0.1024,
0.0933,
0.1096,
0.108,
0.1097,
0.10  //  Array Data

};

CTQL.DoubleVector arrMBinaryBarrier_r =
new  CTQL.DoubleVector(arrBMBinaryBarrier_r);

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


Example range for parameter : b

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


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

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



CTQL.CTRangeData MBinaryBarrier_b = new CTQL.CTRangeData();

System.Text.StringBuilder MBinaryBarrier_b_builder =
new System.Text.StringBuilder(100);

MBinaryBarrier_b_builder.Append("{");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0 ;");
MBinaryBarrier_b_builder.Append("0.00");
MBinaryBarrier_b_builder.Append("}");

// Parse the string into the Range object.
MBinaryBarrier_b.RangeFromStr( MBinaryBarrier_b_builder.ToString() );


Example range for parameter : v

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


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

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



CTQL.CTRangeData MBinaryBarrier_v;


double[] arrBMBinaryBarrier_v = {
0.2169,
0.211,
0.2045,
0.2037,
0.1847,
0.1932,
0.211,
0.2156,
0.1848,
0.2157,
0.2052,
0.2179,
0.1938,
0.1909,
0.2028,
0.1856,
0.2194,
0.2185,
0.2171,
0.20  //  Array Data

};

CTQL.DoubleVector arrMBinaryBarrier_v =
new  CTQL.DoubleVector(arrBMBinaryBarrier_v);

// Second parameter determines whether the array is a column array (false) or a row array (true)
MBinaryBarrier_v = new  CTQL.CTRangeData(arrMBinaryBarrier_v, 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.Pricing20 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 MBinaryBarrier() 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 MBinaryBarrier() function call


Example
NoOfUnitsPositionTypeFlagSXHAdjBarrFreqKTrbvPREMIUM
1LONG1298.6491108105Daily16387340.105200.191624.9219
1LONG1099.4185108107Daily15387340.106800.21224.54573
1LONG1296.0017107100Daily15387340.093200.197416.4883
1LONG11108.26610794Daily16387340.09900.198288.929
1LONG12111.37199103Daily15387340.1100.1939-19.3841
1LONG1096.5525107100Daily14387340.100200.21022.217
1LONG12108.95296103Daily15387340.094100.1992-17.6346
1LONG10103.605107102Daily16387340.097600.2164-1.23298
1LONG11112.0279892Daily15387340.095700.1994103.243
1LONG1197.8099699Daily16387340.104200.1836-19.1713
1LONG12100.75811291Daily16387340.103800.1989-20.8472
1LONG12104.711111104Daily14387340.108400.187-3.891
1LONG12100.388101110Daily14387340.10800.188537.5169
1LONG1299.938810997Daily16387340.097800.204-10.0891
1LONG10113.9894108Daily16387340.096200.1849-3.07745
1LONG1295.4655104107Daily15387340.096400.217641.3019
1LONG11105.1296108Daily16387340.093600.1806-38.7516
1LONG1097.0061101106Daily16387340.097400.18546.46446
1LONG10115.2369298Daily16387340.093600.2173-6.07675
1LONG11105102100Daily15387340.100.244.3048



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