Prototype
Function opt_gfd_vol(theta As Double,
asset_price As Double,
sigma As Variant,
sigma_times As Variant,
r As Double,
T As Double,
strike As Double,
method As Long,
putcall As Long,
log_transform As Long,
q As Double,
ns As Long,
nt As Long,
smax As Double) As Variant
Description
This function calculates the value and hedge statistics of a either an American or European
option. A finite difference theta method on a rectangular grid is used and the time dependence
of the volatility is specified by the user.
Arguments
theta - Double : The value of theta to use.
Note: theta_meth = 0 corresponds to the implicit method,
theta_meth = 0.5 corresponds to the Crank-Nicolson method,
and theta_meth = 1.0 corresponds to the explicit method.
asset_price - Double : The current value of the stock.
sigma - Variant (containing a single column of Double values) : The values of the volatilities.
sigma_times - Variant (containing a single column of Double values) : The times at which the
volatilities occur.
r - Double : The continuously compounded interest rate.
T - Double : The option maturity in years.
strike - Double : The strike price.
method - Long : If method = 0 then the option is European,
If method = 1 then it is American.
Only method < 2 is valid for this routine.
putcall - Long : Indicates whether the option is a put or call.
If putcall = 0 then the option is a call , if putcall = 1 then it is a put.
log_transform - Long : If log_transform = 0 then no logarithmic transform is used.
If log_transform = 1 then a logarithmic transformation is uesd.
q - Double: The continuously compounded dividend rate.
ns - Long : The number of asset steps to be used.
nt - Long : The number of time steps to be used.
smax - Double : The maximum asset value on the grid.
Returned Values
The first element in the output array is the option value. This is followed the greeks in the following order :
gamma, delta, theta.
Other Information
Information on enumeration types
List of available routines