%% Price a Barrier Option Using an ITT Tree
% This example shows how to price a barrier option using an ITT tree by loading the file deriv.mat, which provides ITTTree. The ITTTree structure contains the stock specification and time information needed to price the option.

load deriv.mat;

OptSpec = 'Call';
Strike =  85;
Settle = '01-Jan-2006';
ExerciseDates = '31-Dec-2008';
AmericanOpt = 1;
BarrierSpec = 'UI';
Barrier =  115;

Price = barrierbyitt(ITTTree,OptSpec,Strike,Settle,ExerciseDates,AmericanOpt,...
BarrierSpec,Barrier)

% Copyright 2015 The MathWorks, Inc.