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

    %% Compute the Price and Sensitivities of an Asian Option Using the Levy Model  

% Copyright 2015 The MathWorks, Inc.


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

%% 
% Define the |StockSpec| for the asset. 
AssetPrice = 6.8;
Sigma = 0.14;
DivType = 'continuous';
DivAmounts = 0.09;
StockSpec = stockspec(Sigma, AssetPrice, DivType, DivAmounts)  

%% 
% Define two options for a |'call'| and |'put'|. 
Settle = 'Jan-1-2013';
ExerciseDates = 'Jan-1-2014';
Strike = 6.9;
OptSpec = {'call'; 'put'};  

%% 
% Compute the European arithmetic average price and sensitivities for the
% Asian option using the Levy model. 
OutSpec = {'Price', 'Delta', 'Gamma'};
PriceSens = asiansensbylevy(RateSpec, StockSpec, OptSpec, Strike,...
Settle, ExerciseDates,'OutSpec', OutSpec)