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

    %% Compute the Price and Sensitivities of an Asian Option Using the Kemna-Vorst Model  

% Copyright 2015 The MathWorks, Inc.


%% 
% Define the |RateSpec|. 
StartDates = 'Jan-1-2013';
EndDates = 'Jan-1-2014';
Rates = 0.035;
Basis = 1;
RateSpec = intenvset('ValuationDate', StartDates, 'StartDates', StartDates, ...
'EndDates', EndDates,'Rates', Rates,  'Compounding', -1, 'Basis', Basis)  

%% 
% Define the |StockSpec| for the asset. 
AssetPrice = 100;
Sigma = 0.15;
DivType = 'continuous';
DivAmounts = 0.03;
StockSpec = stockspec(Sigma, AssetPrice, DivType, DivAmounts)  

%% 
% Define the Asian |'call'| and |'put'| options. 
Strike = 102;
OptSpec = {'put'; 'call'};
Settle = 'Jan-1-2013';
ExerciseDates = 'Jan-1-2014';  

%% 
% Compute the European geometric Average Price and sensitivities for the
% Asian option using the Kemna-Vorst model. 
OutSpec = {'Price', 'Delta', 'Gamma'};
PriceSens = asiansensbykv(RateSpec, StockSpec, OptSpec, Strike,...
Settle, ExerciseDates,'OutSpec', OutSpec)