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

    %% Compute the Price 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 |'call'| and |'put'|. 
Settle = 'Jan-1-2013';
Maturity = 'July-1-2013';
Strike = 6.9;
OptSpec = {'call'; 'put'};  

%% 
% Compute the European arithmetic average price for the Asian option using
% the Levy model. 
Price= asianbylevy(RateSpec, StockSpec, OptSpec, Strike, Settle, Maturity)