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

    %% Compute Option Prices and Sensitivities on Futures Using the Black Pricing Model
% This example shows how to compute option prices and sensitivities on
% futures using the Black pricing model. Consider a European put option on a
% futures contract with an exercise price of $60 that expires on June 30,
% 2008. On April 1, 2008 the underlying stock is trading at $58 and has a
% volatility of 9.5% per annum. The annualized continuously compounded
% risk-free rate is 5% per annum. Using this data, compute
% |delta|, |gamma|, and the |price| of the put option.
%%

% Copyright 2015 The MathWorks, Inc.

AssetPrice = 58;
Strike = 60;
Sigma = .095;
Rates = 0.05;
Settle = 'April-01-08';
Maturity = 'June-30-08';

% define the RateSpec and StockSpec
RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, 'EndDates',...
Maturity, 'Rates', Rates, 'Compounding', -1, 'Basis', 1);

StockSpec = stockspec(Sigma, AssetPrice);

% define the options
OptSpec = {'put'};

OutSpec = {'Delta','Gamma','Price'};
[Delta, Gamma, Price] = optstocksensbyblk(RateSpec, StockSpec, Settle,...
Maturity, OptSpec, Strike,'OutSpec', OutSpec)