%% Price an American Stock Option Using a CRR Binomial Tree
% This example shows how to price an American stock option using a CRR binomial tree by loading the file deriv.mat, which provides CRRTree. The CRRTree structure contains the stock specification and time information needed to price the American option.

load deriv.mat;

OptSpec = 'Call';
Strike = 105;
Settle = '01-Jan-2003';
ExerciseDates = '01-Jan-2005';
AmericanOpt = 1;

Price = optstockbycrr(CRRTree, OptSpec, Strike, Settle, ... 
ExerciseDates, AmericanOpt)

% Copyright 2015 The MathWorks, Inc.