Skip to content

Pricing options via binomial trees: European, American, Chooser, Knock-Out, Average Strike

Notifications You must be signed in to change notification settings

nicolaivicol/binomial-tree-options-R

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pricing options via Binomial Trees in R

European, American, Chooser, Knock-Out, Average Strike

The examplesBinomTree.html was generated by: examplesBinomTree.Rmd

Instructions:

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 rate
  • N_steps: number of time steps in tree (# levels = N_steps + 1 at root)
  • isPut: F:Call, T:Put
  • isAmerican: F:European, T:American

and additional inputs for exotic options:
average strike:

  • isAvgStrike: is average strike options

knock-out:

  • isKO: is knock-out option
  • H: barrier strike for knock-out

chooser:

  • isChooser: is chooser option
  • Kc: call strike for chooser option
  • Kp: put strike for chooser option
  • choose_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)

About

Pricing options via binomial trees: European, American, Chooser, Knock-Out, Average Strike

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published