www.gusucode.com > fininst 案例源码程序 matlab代码 > fininst/ComputethePriceofaFloatingLookbackOptionUsingtheGoldmanSExample.m
%% Compute the Price 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.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)