%% Compute the Price of a Floating Lookback Option Using the Goldman-Sosin-Gatto Model
% Define the RateSpec.

StartDates = 'Jan-1-2013';
EndDates = 'Jan-1-2014';
Rates = 0.042;
Compounding = -1;
RateSpec = intenvset('ValuationDate', StartDates, 'StartDates', StartDates,...
'EndDates', EndDates, 'Rates', Rates, 'Compounding', Compounding)

%
% Define the StockSpec.

AssetPrice = 50;
Sigma = 0.36;
StockSpec = stockspec(Sigma, AssetPrice)

%
% Define the floating lookback options.

Settle   = 'Jan-1-2013';
Maturity = 'April-1-2013'; 
OptSpec = {'put';'call'};
Strike = NaN;

%
% Compute the price of the European floating lookback options.

Price = lookbackbycvgsg(RateSpec, StockSpec, OptSpec, Strike, Settle, Maturity)

% Copyright 2015 The MathWorks, Inc.