BjerksundStenslandPriceNGreeks
Updated 2023-11-16 16:35:33.717000
Syntax
SELECT *
FROM [westclintech].[wct].[BjerksundStenslandPriceNGreeks] (
<@CallPut, nvarchar(4000),>
,<@AssetPrice, float,>
,<@StrikePrice, float,>
,<@TimeToMaturity, float,>
,<@RiskFreeRate, float,>
,<@DividendRate, float,>
,<@Volatility, float,>)
Description
Use the table-valued function BjerksundStenslandPriceNGreeks to calculate the price and other derivatives of an American option using the Bjerksund & Stensland 2002 option pricing formula.
Arguments
@DividendRate
the annualized, continuously compounded dividend rate over the life of the option. For currency options, @DividendRate should be the foreign risk-free interest rate. @DividendRate is an expression of type float or of a type that can be implicitly converted to float.
@RiskFreeRate
the annualized, continuously compounded risk-free rate of return over the life of the option. @RiskFreeRate is an expression of type float or of a type that can be implicitly converted to float.
@TimeToMaturity
the time to expiration of the option, expressed in years. @TimeToMaturity is an expression of type float or of a type that can be implicitly converted to float.
@CallPut
identifies the option as being a call ('C') or a put ('P'). @CallPut is an expression of type nvarchar or of a type that can be implicitly converted to nvarchar.
@StrikePrice
the exercise price of the option. @StrikePrice is an expression of type float or of a type that can be implicitly converted to float.
@Volatility
the volatility of the relative price change of the underlying asset. @Volatility is an expression of type float or of a type that can be implicitly converted to float.
@AssetPrice
the price of the underlying asset. @AssetPrice is an expression of type float or of a type that can be implicitly converted to float.
Return Type
table
{"columns": [{"field": "colName", "headerName": "Name", "header": "name"}, {"field": "colDatatype", "headerName": "Type", "header": "type"}, {"field": "colDesc", "headerName": "Description", "header": "description", "minWidth": 1000}], "rows": [{"id": "1104b204-952c-43bb-94cd-b3339634ace9", "colName": "Price", "colDatatype": "float", "colDesc": "The theoretical value of the option."}, {"id": "e6f46c55-46c0-445b-b95b-9c61135b0229", "colName": "Delta", "colDatatype": "float", "colDesc": "The sensitivity to small changes in the asset price; the first derivative of the option with respect to price."}, {"id": "fe691ac4-f142-41b7-8f5f-b8b2641bb65c", "colName": "Gamma", "colDatatype": "float", "colDesc": "The rate of change in Delta with respect to small changes in the asset price; the second derivative of the option with respect to price."}, {"id": "e4e3fcd8-cbcd-4f3d-ab53-ce8d5e264af5", "colName": "Theta", "colDatatype": "float", "colDesc": "The sensitivity to small changes in time; the first derivative of the option with respect to time."}, {"id": "f2a52e4f-e3d2-44e7-bea5-306eb5895dc4", "colName": "Vega", "colDatatype": "float", "colDesc": "The sensitivity to small changes in volatility; the first derivative of the option with respect to volatility."}, {"id": "70b6588c-48b0-44b6-a248-c36780299ac8", "colName": "Rho", "colDatatype": "float", "colDesc": "The sensitivity to small changes in the risk-free rate; the first derivative of the option with respect to the risk-free rate."}, {"id": "2a82b6a5-4573-4836-9982-557806603481", "colName": "Lambda", "colDatatype": "float", "colDesc": "Delta multiplied by the asset price divided by the theoretical value. If the theoretical value is zero, then lambda is set to zero."}, {"id": "31dd27b9-56cb-4dd8-932b-25638798eb0c", "colName": "GammaP", "colDatatype": "float", "colDesc": "Gamma multiplied by asset price divided by strike price."}, {"id": "04ca4da8-fb58-4248-b6a7-d87d0b97a70f", "colName": "DdeltaDtime", "colDatatype": "float", "colDesc": "The instantaneous change in delta over the passage of time; the second derivative, once to asset price and once to time."}, {"id": "c8e719bf-b1a3-4710-9c89-d32de1ceb669", "colName": "DdeltaDvol", "colDatatype": "float", "colDesc": "The sensitivity of delta with respect to volatility; the second derivative, once to asset price and once to volatility."}, {"id": "c655952c-7532-41c9-8795-df8a5e498031", "colName": "DdeltaDvolDvol", "colDatatype": "float", "colDesc": "The second derivative of delta with respect to volatility; the third derivative, once to asset price and twice to volatility."}, {"id": "9ed1850c-cff9-4dec-950a-d1a55adf9477", "colName": "DgammaDvol", "colDatatype": "float", "colDesc": "The rate of change in gamma with respect to changes in volatility; the third derivative, twice to asset price and once to volatility."}, {"id": "c5a0fdd2-5027-4c5b-8b02-8943d09f1786", "colName": "DvegaDvol", "colDatatype": "float", "colDesc": "The rate of change to Vega as the volatility changes; the second derivative with respect to volatility."}, {"id": "ab4fab41-a225-49d1-9155-d34c81db24dd", "colName": "VegaP", "colDatatype": "float", "colDesc": "The percentage change in theoretical value for a 10 per cent change in volatility."}, {"id": "b723d023-9229-4485-a05d-d30cd34cf983", "colName": "PhiRho2", "colDatatype": "float", "colDesc": "The sensitivity to a change in the dividend yield (foreign interest rate for a currency option); the first derivative with respect to dividend yield."}, {"id": "914cd950-276a-47d8-9445-ae212fb8a0ed", "colName": "DgammaDspot", "colDatatype": "float", "colDesc": "The rate of change in gamma with respect to change in the asset price; the third derivative with respect to price."}, {"id": "33f6ccf4-e1e9-416f-84ba-ed2451b4c528", "colName": "DeltaX", "colDatatype": "float", "colDesc": "The sensitivity to a change in the strike price; the first derivative with respect to strike price."}, {"id": "cbc0cfbb-4b9a-40df-a2f0-b2016d114865", "colName": "RiskNeutralDensity", "colDatatype": "float", "colDesc": "The sensitivity of DeltaX; the second derivative with respect to strike price."}, {"id": "ada941f8-79c5-4765-9097-a4575560fe5b", "colName": "DvommaDvol", "colDatatype": "float", "colDesc": "The sensitivity of DvegaDvol to changes in volatility; the third derivative, twice to asset price and once to volatility."}, {"id": "cd106113-e80f-4861-9432-ce36859ff639", "colName": "DgammaDtime", "colDatatype": "float", "colDesc": "The sensitivity of Gamma to the passage of time; the third derivative, twice to asset price and once to time."}, {"id": "24c62c46-20e4-4966-af06-bd15e0331e91", "colName": "DvegaDtime", "colDatatype": "float", "colDesc": "The sensitivity of Vega to the passage of time; the second derivative, once to volatility and once to time."}, {"id": "3a8ceed1-3a0f-42df-bc47-3e495a74f4db", "colName": "ForwardPrice", "colDatatype": "float", "colDesc": "The value of the underlying asset at the expiration date of the option."}, {"id": "ae0b0d40-cb44-4a1f-b42d-8dff9779c29c", "colName": "ForwardPoints", "colDatatype": "float", "colDesc": "The difference between the ForwardPrice and the asset price."}]}
Remarks
@TimeToMaturity must be greater than zero (@TimeToMaturity > 0).
@AssetPrice must be greater than zero (@AssetPrice > 0).
@StrikePrice must be greater than zero (@StrikePrice > 0).
@Price must be greater than zero.
If @DividendRate is NULL then @DividendRate = 0.
If @RiskFreeRate is NULL then @RiskFreeRate = 0.
Examples
Calculate the price and Greeks for a put option on 2012-09-04, expiring on 2012-12-15, with a current asset price of 99.5, a strike price of 100 and a volatility of .20. The risk free rate is 2% and the dividend rate is 0.5%.
SELECT *
FROM wct.BjerksundStenslandPriceNGreeks( 'P', --PutCall
99.5, --Asset Price
100, --Strike Price
datediff(d, '2012-09-04', '2012-12-15') / 365.0000, --Time-to-expiry
.02, --Risk Free Rate
.005, --Dividend Rate
.20 --Price
) k;
Here is the resultant table.
{"columns":[{"field":"Price","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Delta","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Gamma","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Theta","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Vega","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Rho","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Lambda","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"GammaP","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DdeltaDtime","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DdeltaDvol","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DdeltaDvolDvol","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DgammaDvol","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DvegaDvol","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"VegaP","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"PhiRho2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DgammaDspot","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DeltaX","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"RiskNeutralDensity","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DvommaDvol","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DgammaDtime","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DvegaDtime","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"ForwardPrice","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"ForwardPoints","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Price":"4.25309729423103","Delta":"-0.485618953973699","Gamma":"0.0385625753551722","Theta":"-0.0186272357466208","Vega":"0.209275569006806","Rho":"-0.129024971219138","Lambda":"-11.3609171334791","GammaP":"0.0383697624783963","DdeltaDtime":"-0.000250643463366269","DdeltaDvol":"0.00144320289052757","DdeltaDvolDvol":"-4.27457486296134E-05","DgammaDvol":"-0.00198143297325259","DvegaDvol":"-8.10906897186214E-06","VegaP":"0.418551138013612","PhiRho2":"0.12022472119142","DgammaDspot":"-0.000643122888277503","DeltaX":"0.525721832111969","RiskNeutralDensity":"0.0381881193334266","DvommaDvol":"-6.06312401885134E-06","DgammaDtime":"0.000185778669160692","DvegaDtime":"-0.101735879264365","ForwardPrice":"99.9179575658694","ForwardPoints":"0.417957565869372"}]}
In this SELECT we unpivot the columns returned by the function for ease of viewing the results.
SELECT n.*
FROM wct.BjerksundStenslandPriceNGreeks( 'P', --PutCall
99.5, --Asset Price
100, --Strike Price
datediff(d, '2012-09-04', '2012-12-15') / 365.0000, --Time-to-expiry
.02, --Risk Free Rate
.005, --Dividend Rate
.20 --Price
) k
CROSS APPLY
(
VALUES
('Price', Price),
('Delta', Delta),
('Gamma', Gamma),
('Theta', Theta),
('Vega', Vega),
('Rho', Rho),
('Lambda', Lambda),
('GammaP', GammaP),
('DdeltaDtime', DdeltaDtime),
('DdeltaDvol', DdeltaDvol),
('DdeltaDvolDvol', DdeltaDvolDvol),
('DgammaDvol', DgammaDvol),
('DvegaDvol', DvegaDvol),
('VegaP', VegaP),
('PhiRho2', PhiRho2),
('DgammaDspot', DgammaDspot),
('DeltaX', DeltaX),
('RiskNeutralDensity', RiskNeutralDensity),
('DvommaDvol', DvommaDvol),
('DgammaDtime', DgammaDtime),
('DvegaDtime', DvegaDtime),
('ForwardPrice', ForwardPrice),
('ForwardPoints', ForwardPoints)
) n ([Return Value], Value);
This produces the following result.
{"columns":[{"field":"Return Value"},{"field":"Value","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Return Value":"Price","Value":"4.253097294231"},{"Return Value":"Delta","Value":"-0.485618954151334"},{"Return Value":"Gamma","Value":"0.0385703913252655"},{"Return Value":"Theta","Value":"-0.0186272357466564"},{"Return Value":"Vega","Value":"0.209275569007161"},{"Return Value":"Rho","Value":"-0.129024971220559"},{"Return Value":"Lambda","Value":"-11.3609171376349"},{"Return Value":"GammaP","Value":"0.0383775393686392"},{"Return Value":"DdeltaDtime","Value":"-0.000250644436712482"},{"Return Value":"DdeltaDvol","Value":"0.00144318512695918"},{"Return Value":"DdeltaDvolDvol","Value":"-4.27457528928699E-05"},{"Return Value":"DgammaDvol","Value":"-0.00198143290219832"},{"Return Value":"DvegaDvol","Value":"-8.10871370049426E-06"},{"Return Value":"VegaP","Value":"0.418551138014323"},{"Return Value":"PhiRho2","Value":"0.120224721192841"},{"Return Value":"DgammaDspot","Value":"-0.000643179731696364"},{"Return Value":"DeltaX","Value":"0.525721831898807"},{"Return Value":"RiskNeutralDensity","Value":"0.0381909615043696"},{"Return Value":"DvommaDvol","Value":"-6.06312403661491E-06"},{"Return Value":"DgammaDtime","Value":"0.000185778630226844"},{"Return Value":"DvegaDtime","Value":"-0.101735880237712"},{"Return Value":"ForwardPrice","Value":"99.9179575658694"},{"Return Value":"ForwardPoints","Value":"0.417957565869372"}]}
In the following SELECT, we will populate a derived table with some option information and then calculate the price and Greeks for options contained therein. For demonstration purposes we have made lots of simplifying assumptions about the US and contra interest rates and the implied volatility. This just demonstrates the structure o f the TSQL statement.
SET NOCOUNT ON;
/*Create a temporary table to store data*/
CREATE TABLE #opt
(
z char(1),
s money,
ex datetime,
vol money
);
/*Put data in the table*/
INSERT INTO #opt
VALUES
('C', 98, '2012-09-22', 0.23);
INSERT INTO #opt
VALUES
('P', 99, '2012-09-22', 0.15);
INSERT INTO #opt
VALUES
('C', 100, '2012-09-22', 0.15);
INSERT INTO #opt
VALUES
('C', 101, '2012-09-22', 0.21);
INSERT INTO #opt
VALUES
('P', 102, '2012-09-22', 0.19);
INSERT INTO #opt
VALUES
('P', 98, '2012-10-20', 0.18);
INSERT INTO #opt
VALUES
('P', 99, '2012-10-20', 0.24);
INSERT INTO #opt
VALUES
('C', 100, '2012-10-20', 0.21);
INSERT INTO #opt
VALUES
('P', 101, '2012-10-20', 0.25);
INSERT INTO #opt
VALUES
('P', 102, '2012-10-20', 0.25);
INSERT INTO #opt
VALUES
('P', 98, '2012-11-17', 0.17);
INSERT INTO #opt
VALUES
('C', 99, '2012-11-17', 0.24);
INSERT INTO #opt
VALUES
('P', 100, '2012-11-17', 0.17);
INSERT INTO #opt
VALUES
('P', 101, '2012-11-17', 0.25);
INSERT INTO #opt
VALUES
('P', 102, '2012-11-17', 0.22);
INSERT INTO #opt
VALUES
('C', 98, '2012-12-22', 0.21);
INSERT INTO #opt
VALUES
('C', 99, '2012-12-22', 0.19);
INSERT INTO #opt
VALUES
('C', 100, '2012-12-22', 0.21);
INSERT INTO #opt
VALUES
('C', 101, '2012-12-22', 0.15);
INSERT INTO #opt
VALUES
('P', 102, '2012-12-22', 0.22);
INSERT INTO #opt
VALUES
('C', 98, '2013-03-16', 0.24);
INSERT INTO #opt
VALUES
('C', 99, '2013-03-16', 0.17);
INSERT INTO #opt
VALUES
('P', 100, '2013-03-16', 0.2);
INSERT INTO #opt
VALUES
('C', 101, '2013-03-16', 0.19);
INSERT INTO #opt
VALUES
('C', 102, '2013-03-16', 0.21);
INSERT INTO #opt
VALUES
('P', 98, '2013-03-22', 0.16);
INSERT INTO #opt
VALUES
('P', 99, '2013-03-22', 0.25);
INSERT INTO #opt
VALUES
('P', 100, '2013-03-22', 0.23);
INSERT INTO #opt
VALUES
('C', 101, '2013-03-22', 0.22);
INSERT INTO #opt
VALUES
('P', 102, '2013-03-22', 0.16);
/*Select date*/
SELECT O.z,
O.s as Strike,
O.ex as exDate,
O.vol as Volatility,
Cast(k.Price as money) as Price,
Cast(k.Delta as money) as Delta,
Cast(k.Gamma as money) as Gamma,
Cast(k.Theta as money) as Theta,
Cast(k.Vega as money) as Vega,
Cast(k.Rho as money) as Rho,
Cast(k.Lambda as money) as Lambda
FROM #OPT O
CROSS APPLY wct.BjerksundStenslandPriceNGreeks( O.z, --PutCall
96.76, --Asset Price
O.s, --Strike Price
datediff(d, '2012-09-04', O.ex) / 365.0000, --Time-to-expiry
0.0569, --Risk Free Rate
0.00284, --Dividend Rate
O.vol --Volatility
) k;
/*Clean up table*/
DROP TABLE #opt;
This produces the following result.
{"columns":[{"field":"z"},{"field":"Strike","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"exDate","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Volatility","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Price","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Delta","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Gamma","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Theta","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Vega","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Rho","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Lambda","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"z":"C","Strike":"98.00","exDate":"2012-09-22 00:00:00.000","Volatility":"0.23","Price":"1.53","Delta":"0.4318","Gamma":"0.0795","Theta":"-0.0606","Vega":"0.0845","Rho":"0.0199","Lambda":"27.3097"},{"z":"P","Strike":"99.00","exDate":"2012-09-22 00:00:00.000","Volatility":"0.15","Price":"2.564","Delta":"-0.747","Gamma":"0.115","Theta":"-0.0209","Vega":"0.0675","Rho":"-0.0245","Lambda":"-28.1882"},{"z":"C","Strike":"100.00","exDate":"2012-09-22 00:00:00.000","Volatility":"0.15","Price":"0.3233","Delta":"0.1861","Gamma":"0.0831","Theta":"-0.0266","Vega":"0.0576","Rho":"0.0087","Lambda":"55.7059"},{"z":"C","Strike":"101.00","exDate":"2012-09-22 00:00:00.000","Volatility":"0.21","Price":"0.4949","Delta":"0.2007","Gamma":"0.0622","Theta":"-0.038","Vega":"0.0603","Rho":"0.0093","Lambda":"39.2314"},{"z":"P","Strike":"102.00","exDate":"2012-09-22 00:00:00.000","Volatility":"0.19","Price":"5.3142","Delta":"-0.9137","Gamma":"0.0579","Theta":"-0.0113","Vega":"0.0322","Rho":"-0.0182","Lambda":"-16.6365"},{"z":"P","Strike":"98.00","exDate":"2012-10-20 00:00:00.000","Volatility":"0.18","Price":"2.8239","Delta":"-0.5417","Gamma":"0.0694","Theta":"-0.0202","Vega":"0.1348","Rho":"-0.0539","Lambda":"-18.5597"},{"z":"P","Strike":"99.00","exDate":"2012-10-20 00:00:00.000","Volatility":"0.24","Price":"4.2143","Delta":"-0.5719","Gamma":"0.0508","Theta":"-0.0281","Vega":"0.1339","Rho":"-0.0591","Lambda":"-13.1299"},{"z":"C","Strike":"100.00","exDate":"2012-10-20 00:00:00.000","Volatility":"0.21","Price":"1.8111","Delta":"0.377","Gamma":"0.0526","Theta":"-0.035","Vega":"0.1304","Rho":"0.0437","Lambda":"20.1391"},{"z":"P","Strike":"101.00","exDate":"2012-10-20 00:00:00.000","Volatility":"0.25","Price":"5.6361","Delta":"-0.66","Gamma":"0.0469","Theta":"-0.0265","Vega":"0.1246","Rho":"-0.0637","Lambda":"-11.3316"},{"z":"P","Strike":"102.00","exDate":"2012-10-20 00:00:00.000","Volatility":"0.25","Price":"6.3454","Delta":"-0.704","Gamma":"0.0453","Theta":"-0.0243","Vega":"0.1172","Rho":"-0.0644","Lambda":"-10.7359"},{"z":"P","Strike":"98.00","exDate":"2012-11-17 00:00:00.000","Volatility":"0.17","Price":"3.1341","Delta":"-0.5194","Gamma":"0.0601","Theta":"-0.0138","Vega":"0.1703","Rho":"-0.0789","Lambda":"-16.0348"},{"z":"C","Strike":"99.00","exDate":"2012-11-17 00:00:00.000","Volatility":"0.24","Price":"3.6374","Delta":"0.4773","Gamma":"0.0381","Theta":"-0.0345","Vega":"0.1734","Rho":"0.0863","Lambda":"12.696"},{"z":"P","Strike":"100.00","exDate":"2012-11-17 00:00:00.000","Volatility":"0.17","Price":"4.3404","Delta":"-0.6383","Gamma":"0.061","Theta":"-0.012","Vega":"0.158","Rho":"-0.0843","Lambda":"-14.2293"},{"z":"P","Strike":"101.00","exDate":"2012-11-17 00:00:00.000","Volatility":"0.25","Price":"6.2894","Delta":"-0.6126","Gamma":"0.0391","Theta":"-0.0209","Vega":"0.1647","Rho":"-0.0953","Lambda":"-9.4244"},{"z":"P","Strike":"102.00","exDate":"2012-11-17 00:00:00.000","Volatility":"0.22","Price":"6.4887","Delta":"-0.6789","Gamma":"0.0443","Theta":"-0.0159","Vega":"0.1524","Rho":"-0.0934","Lambda":"-10.1239"},{"z":"C","Strike":"98.00","exDate":"2012-12-22 00:00:00.000","Volatility":"0.21","Price":"4.5827","Delta":"0.5342","Gamma":"0.0358","Theta":"-0.0272","Vega":"0.21","Rho":"0.1407","Lambda":"11.2803"},{"z":"C","Strike":"99.00","exDate":"2012-12-22 00:00:00.000","Volatility":"0.19","Price":"3.6978","Delta":"0.4944","Gamma":"0.0397","Theta":"-0.0249","Vega":"0.2108","Rho":"0.1318","Lambda":"12.9366"},{"z":"C","Strike":"100.00","exDate":"2012-12-22 00:00:00.000","Volatility":"0.21","Price":"3.6902","Delta":"0.4642","Gamma":"0.0358","Theta":"-0.0263","Vega":"0.2099","Rho":"0.1231","Lambda":"12.1709"},{"z":"C","Strike":"101.00","exDate":"2012-12-22 00:00:00.000","Volatility":"0.15","Price":"2.0622","Delta":"0.3874","Gamma":"0.0483","Theta":"-0.0192","Vega":"0.2024","Rho":"0.1058","Lambda":"18.1769"},{"z":"P","Strike":"102.00","exDate":"2012-12-22 00:00:00.000","Volatility":"0.22","Price":"6.9908","Delta":"-0.6357","Gamma":"0.0388","Theta":"-0.0131","Vega":"0.1929","Rho":"-0.1286","Lambda":"-8.7993"},{"z":"C","Strike":"98.00","exDate":"2013-03-16 00:00:00.000","Volatility":"0.24","Price":"7.4524","Delta":"0.5698","Gamma":"0.0232","Theta":"-0.0242","Vega":"0.2759","Rho":"0.2521","Lambda":"7.3984"},{"z":"C","Strike":"99.00","exDate":"2013-03-16 00:00:00.000","Volatility":"0.17","Price":"5.0277","Delta":"0.5422","Gamma":"0.0331","Theta":"-0.0193","Vega":"0.2786","Rho":"0.2508","Lambda":"10.4339"},{"z":"P","Strike":"100.00","exDate":"2013-03-16 00:00:00.000","Volatility":"0.20","Price":"6.1762","Delta":"-0.531","Gamma":"0.0344","Theta":"-0.0086","Vega":"0.2686","Rho":"-0.1887","Lambda":"-8.3196"},{"z":"C","Strike":"101.00","exDate":"2013-03-16 00:00:00.000","Volatility":"0.19","Price":"4.6921","Delta":"0.4855","Gamma":"0.0298","Theta":"-0.02","Vega":"0.2801","Rho":"0.2236","Lambda":"10.0126"},{"z":"C","Strike":"102.00","exDate":"2013-03-16 00:00:00.000","Volatility":"0.21","Price":"4.8451","Delta":"0.4667","Gamma":"0.0269","Theta":"-0.0211","Vega":"0.2793","Rho":"0.2132","Lambda":"9.3202"},{"z":"P","Strike":"98.00","exDate":"2013-03-22 00:00:00.000","Volatility":"0.16","Price":"4.052","Delta":"-0.4734","Gamma":"0.0429","Theta":"-0.0063","Vega":"0.2701","Rho":"-0.1665","Lambda":"-11.3038"},{"z":"P","Strike":"99.00","exDate":"2013-03-22 00:00:00.000","Volatility":"0.25","Price":"7.0533","Delta":"-0.4801","Gamma":"0.0254","Theta":"-0.012","Vega":"0.2784","Rho":"-0.2034","Lambda":"-6.5869"},{"z":"P","Strike":"100.00","exDate":"2013-03-22 00:00:00.000","Volatility":"0.23","Price":"7.0514","Delta":"-0.5133","Gamma":"0.0285","Theta":"-0.0104","Vega":"0.2764","Rho":"-0.2034","Lambda":"-7.0439"},{"z":"C","Strike":"101.00","exDate":"2013-03-22 00:00:00.000","Volatility":"0.22","Price":"5.6654","Delta":"0.4987","Gamma":"0.0253","Theta":"-0.022","Vega":"0.2846","Rho":"0.2322","Lambda":"8.5172"},{"z":"P","Strike":"102.00","exDate":"2013-03-22 00:00:00.000","Volatility":"0.16","Price":"6.4279","Delta":"-0.6507","Gamma":"0.0483","Theta":"-0.005","Vega":"0.24","Rho":"-0.1699","Lambda":"-9.7956"}]}
In this example, we translate some of the Greek values into monetary values in order to anticipate how changes in volatility, underlying, and time might affect the profit (or loss) on a long call position with a notional value of 10,000,000, which was bought at 0.50.
DECLARE @notional as float;
DECLARE @position as float;
SET @position = .50;
SET @notional = 10000000;
SELECT n.S as Spot,
CAST((k.Price - @position) * @notional / 100 as money) as [P/L],
CAST(k.Delta * @notional / 100 as money) as Delta,
CAST(k.Gamma * @notional / 100 as money) as Gamma,
CAST(k.Vega * @notional / 100 as money) as Vega
FROM
(
SELECT 122
UNION ALL
SELECT 123.50
UNION ALL
SELECT 124
UNION ALL
SELECT 124.50
UNION ALL
SELECT 125
UNION ALL
SELECT 125.5
UNION ALL
SELECT 126
UNION ALL
SELECT 126.50
UNION ALL
SELECT 127
) n(s)
CROSS APPLY wct.BjerksundStenslandPriceNGreeks( 'C',
n.s, --Asset price
125, --Strike
Cast(7 as float) / cast(365 as float), --Time
0.000335699, --Continuously Compounded EURIBOR
0.001869966, --Continuously Compounded LIBOR
.09 --Volatility
) k
ORDER BY 1 DESC;
This produces the following result.
{"columns":[{"field":"Spot","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"P/L","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Delta","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Gamma","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Vega","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Spot":"127.00","P/L":"157135.9681","Delta":"89662.8007","Gamma":"10548.1135","Vega":"3136.381"},{"Spot":"126.50","P/L":"113838.2075","Delta":"83095.3223","Gamma":"15731.7714","Vega":"4406.4977"},{"Spot":"126.00","P/L":"74467.4052","Delta":"73981.2195","Gamma":"20596.5733","Vega":"5657.3932"},{"Spot":"125.50","P/L":"40219.1873","Delta":"62710.9671","Gamma":"24188.4379","Vega":"6576.4603"},{"Spot":"125.00","P/L":"11972.3403","Delta":"50157.5391","Gamma":"25608.955","Vega":"6904.887"},{"Spot":"124.50","P/L":"-9927.0602","Delta":"37537.2935","Gamma":"24446.2228","Vega":"6539.4324"},{"Spot":"124.00","P/L":"-25762.465","Delta":"26090.6869","Gamma":"21027.9438","Vega":"5579.8336"},{"Spot":"123.50","P/L":"-36369.1365","Delta":"16733.6614","Gamma":"16274.555","Vega":"4284.1527"},{"Spot":"122.00","P/L":"-48513.0559","Delta":"2587.4156","Gamma":"3956.1598","Vega":"1016.2707"}]}