This package provide a way to simulate a fully random stock ticker based on theory provided by __“Stochastic Calculus For Finance ii”, Shreve“__
It returns a data.frame containing the following variables:
library(StockPriceSimulator)
##
## Attaching package: 'StockPriceSimulator'
## The following object is masked from 'package:base':
##
## gamma
stock_tick <- sstock()
### sstock()
It returns a data.frame containing the following variables:
The computed path is based on approximation given by the Itô’s formula.
library(StockPriceSimulator)
## Call the path generating function from equation:
stock_tick <- sstock(scale = 1000)
## Call the path generating function from Itôs approximation
stock_tick_ito <- sstock_ito(scale = 1000)
Delta return the position one should take in order to hedge a short position in a call.
# Create a stoch price motion from 0 to 4(Year) with a daily step
S <- sstock(initial_stock_price = 50,
time_to_maturity = 4,
scale = 360)
# According to the previous sampled path, the option price is computed
# With option in the money
C <- BSM(stock_path = S)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.