App for the valuation of exotic options using the Monte Carlo simulation in different model environments.
Online version:
https://exoticoptions.shinyapps.io/exoticoptions/?_ga=2.136252210.2064526663.1675284358-1995696272.1673430467
Made with "shinyapps.io". Tutorial here: https://shiny.rstudio.com/articles/shinyapps.html
Packages beyond the default packages are listed here. Those packages are mandatory for execution of the program.
- shiny
- shinydashboard
- waiter
- quantmod
- gridExtra
- shinyjs
- shinycssloaders
- timeDate
- ggplot2
- matrixStats
- MASS
This is a small overview of the used funcitons inside the files.
Functions for calculation of the option prices
- firstValueRow
Returns matrix with only the first value of each row replacing all other values by 0. Used after iterative process for American options. - simulate.Heston
Heston simulation which creates stock paths. - create.StockPaths
Generate random stock paths with either Black-Scholes or Heston model. - is.convertible.to.date
Checks if handed over string is convertible to an date object. - create.Holidays
Excludes bank holidays from calendar. - price.Option
Price the passed option.
Functions not directly for calculation of the option prices
- set.active.option
Function that detects, which option is calculated and stores this value, so that the functions "check.Input_na" and "check.Input" know, which option is active. - check.Heston_na
Check if the paramters used for the heston path plot are NA. - check.Heston
Check if the paramters used for the heston path plot are correct. - check.Input_na
Check if the option specific parameters are not NA. - check.Input
Check if the option specific parameters are correct. - create.warning
Checks if the option specific calculation is up to date. Works because of the reactive behavior. The function is checked each time a input or reactive variable changes. - choose.maturity.Input
Detects if the selected maturity is an "date" or "years" input. - get.riskFreeRate
Calls the current risk free rate from the web. - create.Progressbox_price
Creates a progressbox for the price of the option. - create.Progressbox_SD
Creates a progressbox for the standard deviation of the option. - create.Progressbox_SE
Creates a progressbox for the standard error of the option. - create.Conditional.Maturity
Creates the panel with the maturity as either date or year. - create.Histogram
Creates an histogram of the discounted payoff with the package ggplot2.
All functions and techniques are used pretty straightforward and consistent to the shiny tutorials. Additionally, the comments help to understand what happens in the according lines.
The UI is built with the additional package "shinydashboard". A tutorial can be found in the web.