www.gusucode.com > fininst 案例源码程序 matlab代码 > fininst/PriceSensitiviSupershareDigitalOptExample.m

    %% Compute Price and Sensitivities of Supershare Digital Options Using Black-Scholes Model
% This example shows how to compute price and sensitivities of supershare
% digital options using a Black-Scholes model. Consider a supershare based
% on a portfolio of nondividend paying stocks with a lower strike of 350
% and an upper strike of 450. The value of the portfolio on November 1,
% 2008 is 400. The risk-free rate is 4.5% and the volatility is 18%. Using
% this data, calculate the price and sensitivity of the supershare option
% on February 1, 2009.
%%

% Copyright 2015 The MathWorks, Inc.

Settle = 'Nov-1-2008';
Maturity = 'Feb-1-2009';
Rates = 0.045;
Basis = 1;
Compounding = -1;

% define the RateSpec
RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle,...
'EndDates', Maturity, 'Rates', Rates, 'Compounding', Compounding, 'Basis', Basis);

% define the StockSpec
AssetPrice = 400;
Sigma = .18;
StockSpec = stockspec(Sigma, AssetPrice);

% define the high and low strike points
StrikeLow = 350;
StrikeHigh = 450;

% calculate the price
Pssh = supersharebybls(RateSpec, StockSpec, Settle, Maturity,...
StrikeLow, StrikeHigh)

% compute the delta and theta of the supershare option
OutSpec = { 'delta';'theta'};
[Delta, Theta]= supersharesensbybls(RateSpec, StockSpec, Settle,...
Maturity, StrikeLow, StrikeHigh, 'OutSpec', OutSpec)