European, American, Chooser, Knock-Out, Average Strike
Examples of pricing: view examplesBinomTree.html in browser
The examplesBinomTree.html was generated by: examplesBinomTree.Rmd
The getBinomTree
function returns a data frame having the binomial tree mapped into it.
The first row contains the root node information with option price in df$P[1]
.
getBinomTree(S0, K, vol, dT, r, qdiv, N_steps, isPut=F, isAmerican=F,
isAvgStrike=F, isKO=F, isChooser=F, H=NA, Kc=NA, Kp=NA, choose_t1=NA)
with the standard inputs for European and American options:
S0
: underlying asset price at t=0 (e.g. 100)K
: strike (e.g. 105)vol
: volatility (e.g. 0.15 for 15%)dT
: time to maturity (years) (e.g. 1)r
: risk-free rate (e.g. 0.05)qdiv
: dividend rateN_steps
: number of time steps in tree (# levels = N_steps + 1 at root)isPut
: F:Call, T:PutisAmerican
: F:European, T:American
and additional inputs for exotic options:
average strike:
isAvgStrike
: is average strike options
knock-out:
isKO
: is knock-out optionH
: barrier strike for knock-out
chooser:
isChooser
: is chooser optionKc
: call strike for chooser optionKp
: put strike for chooser optionchoose_t1
: time to choose for chooser option
For convenience the getBinomTree
function has several "envelope" functions:
- average strike:
getBinomTree.avgK(S0, K, vol, dT, r, qdiv, N_steps, Kc, Kp, choose_t1)
- knock-out:
getBinomTree.ko(S0, K, vol, dT, r, qdiv, N_steps, isPut, H)
- chooser:
getBinomTree.avgK(S0, vol, dT, r, qdiv, N_steps, isPut)