%% Compute an American Option Price and Sensitivities Using the Heston Model
% Define the option variables and Heston model parameters.

AssetPrice = 10;
Strike = 10;
Rate = 0.1;
Settle = '01-Jan-2017';
ExerciseDates = '02-Apr-2017';

V0 = 0.0625;
ThetaV = 0.16;
Kappa = 5.0;
SigmaV = 0.9;
RhoSV = 0.1;

% Compute the American put option price and sensitivities.

OptSpec = 'Put';
[Price,Delta,Gamma,Rho,Theta,Vega,VegaLT] = optSensByHestonFD(Rate, AssetPrice, Settle, ExerciseDates, ...
OptSpec, Strike, V0, ThetaV, Kappa, SigmaV, RhoSV, 'AmericanOpt', 1, ...
'OutSpec', ["Price" "Delta" "Gamma" "Rho" "Theta" "Vega" "VegaLT"])

% Copyright 2018 The MathWorks, Inc.