Description Usage Arguments Value Examples
The hestonSLVBarrierPricer
function evaluates a barrier option
with European exercise under the Heston Stochastic Volatility model using Finite Difference methods.
The option value and the common first derivatives ("Greeks") are returned.
1 2 3 | hestonSLVBarrierPricer(referenceDate, barrier, rebate, barrierType, strike, optionType,
maturityDate, hestonProcess, leverageFunction, tGrid=51, xGrid=401,
vGrid=51, dampingSteps=0, fdmScheme = "ModifiedCraigSneyd")
|
referenceDate |
a date setting the reference date for the calculation |
barrier |
the barrier level |
rebate |
rebate if barrier is knocked out |
barrierType |
a string with one of the values “downin”, “downout”, “upin” or “upout” |
strike |
the strike price of the option |
optionType |
a string with one of the values “call” or “put” |
maturityDate |
the maturity date of the barrier option |
hestonProcess |
the Heston model part of the HestonSLV specification |
leverageFunction |
the leverage function of the HestonSLV model |
tGrid |
number of time steps for the Finite Difference scheme |
xGrid |
number of grid points in spot direction |
vGrid |
number of grid points in variance direction |
dampingSteps |
number of damping steps to avoid spurious oscillations |
fdmScheme |
the Finite Difference scheme, a string with one of the values “Hundsdorfer”, “ModifiedHundsdorfer”, “Douglas”, “CraigSneyd”, “ModifiedCraigSneyd”, “ImplicitEuler” or “ExplicitEuler” |
The hestonSLVBarrierPricer
function returns a list with the following
components:
value |
npv of option |
delta |
change in option value for a change in the underlying |
gamma |
change in option delta for a change in the underlying |
theta |
change in option value for a change in t |
impliedVol |
implied Black-Scholes-Merton volatility of the option |
1 2 3 4 5 6 7 8 9 10 11 | process <- HestonProcess(function(t,s) {0.05}, function(t,s) {0.02},
100, 0.09, 1.0, 0.06, 0.4, -0.75)
leverageFct <- function(t, s) { exp(-t)*(s+70)/100.0 }
b <- seq(50, 100, 5)
plot(b, sapply(b, function(barrier) {
hestonSLVBarrierPricer(Sys.Date(), barrier, 0.0, "downout", 100, "put",
Sys.Date()+365, process, leverageFct)$gamma
}), type="b",lty=2, ylab="NPV",xlab="Strike"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.