hestonSLVDoubleNoTouchBarrierPricer: Double No Touch Barrier Option Pricer for the Heston SLV...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

The hestonSLVDoubleNoTouchBarrierPricer function evaluates a double-no-touch 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.

Usage

1
2
3
4
  hestonSLVDoubleNoTouchBarrierPricer(
       referenceDate, barrier_lo, barrier_hi, rebate, barrierType, strike, optionType,
       payoffType, maturityDate, hestonProcess, leverageFunction, tGrid=51, xGrid=401,
       vGrid=51, dampingSteps=0, fdmScheme = "ModifiedCraigSneyd")

Arguments

referenceDate

a date setting the reference date for the calculation

barrier_lo

the lower barrier

barrier_lo

the upper barrier

rebate

rebate if barrier is knocked out

barrierType

a string with one of the values “KnockIn”, “KnockOut”, “KIKO” or “KOKI”

strike

the strike price of the option

optionType

a string with one of the values “call” or “put”

payofftype

a string with one of the values “PlainVanilla”, “CashOrNothing” or “AssetOrNothing”

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”

Value

The hestonSLVDoubleNoTouchBarrierPricer function returns a list with the following components:

value

value of option

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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 }

s <- seq(50, 150, 5)
plot(s, sapply(s, function(spot) {
  process["spot"] <- spot
  hestonSLVDoubleNoTouchBarrierPricer(Sys.Date(), 50, 150, 0.0, "KnockOut", 0, "call",
                                      "CashOrNothing", Sys.Date()+365, process,
                                      leverageFct)$value
  }), type="b",lty=2, ylab="NPV",xlab="Strike"
)

klausspanderen/RHestonSLV documentation built on Oct. 4, 2021, 11:10 a.m.