%% Compute the Option Price on a Future
% Consider a call European option on the Crude Oil Brent futures. The option expires on December 1, 2014 with an exercise price of $120. Assume that on April 1, 2014 futures price is at $105, the annualized continuously compounded risk-free rate is 3.5% per annum and volatility is 22% per annum. Using this data, compute the price of the option.
% Define the RateSpec.

ValuationDate = 'January-1-2014';
EndDates = 'January-1-2015';
Rates = 0.035;
Compounding = -1;
Basis = 1;
RateSpec  = intenvset('ValuationDate', ValuationDate, 'StartDates', ValuationDate,...
'EndDates', EndDates, 'Rates', Rates, 'Compounding', Compounding, 'Basis', Basis')

%
% Define the StockSpec.

AssetPrice = 105;
Sigma = 0.22;
StockSpec  = stockspec(Sigma, AssetPrice)

%
% Define the option.

Settle = 'April-1-2014';
Maturity = 'Dec-1-2014'; 
Strike = 120;
OptSpec = {'call'};

%
% Price the futures call option.

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

% Copyright 2015 The MathWorks, Inc.