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

    %% Compute the Price and Delta of a Floating Lookback Option Using the Goldman-Sosin-Gatto Model  

% Copyright 2015 The MathWorks, Inc.


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

%% 
% Define the |StockSpec| with continuous dividend yield. 
AssetPrice = 120;
Sigma = 0.3;
Yield = 0.045;
StockSpec = stockspec(Sigma, AssetPrice, 'Continuous', Yield)  

%% 
% Define the floating lookback option.  
Settle   = 'Jan-1-2013';
Maturity = 'July-1-2013'; 
OptSpec = 'call';
Strike = NaN;
SMinMax = 100;  

%% 
% Compute the price and delta of the European floating lookback option. 
OutSpec = {'price', 'delta'};
[Price, Delta] = lookbacksensbycvgsg(RateSpec, StockSpec, OptSpec, Strike,...
Settle, Maturity,'AssetMinMax', SMinMax, 'OutSpec', OutSpec)