The objective of this project is to use the optionpricer
package to price a European-style down-and-out call option using Monte
Carlo simulation. Additionally, we aim to analyze the relationship
between the theoretical price of the option and two key factors:
Volatility (σ) of the underlying asset’s returns, and Time
to maturity (T) of the option.
n_sim) is set to
10,000 to ensure statistical accuracy.dt) are used, assuming 252 trading
days in a year.S0) is fixed
at 105.K) is fixed at
110.r) is 5%.L) is set at 100.# install.packages("/Users/paidamoyo/Desktop/optionpricer_0.1.0.tar.gz", repos = NULL, type = "source")
library(optionpricer)
library(ggplot2)
The down-and-out call option is priced based on the following parameters:
Initial Price (S0): The price of
the underlying asset at the time of pricing.
Strike Price (K): The price at
which the holder can buy the underlying asset.
Volatility (σ): Annualized standard
deviation of the underlying asset’s returns.
Time to Maturity (T): The duration
of the option in years.
Barrier Level (L): The level below
which the option is canceled.
Number of Iterations (n_sim): The
number of Monte Carlo simulations.
S0 <- 105
K <- 110
r <- 0.05
L <- 100
n_sim <- 10000
sigma_values <- seq(0.15, 0.3, by = 0.01)
T_values <- seq(0.25, 1, by = 0.25)
results <- expand.grid(sigma = sigma_values, T = T_values)
results$price <- mapply(function(sigma, T) {
down_and_out_call_price(S0, K, r, sigma, T, L, n_sim)
}, results$sigma, results$T)
The following plot shows the relationship between the option price,
volatility (σ), and time to maturity (T).
ggplot(results, aes(x = sigma, y = price, color = as.factor(T))) +
geom_line() +
labs(
title = "Option Price vs. Volatility and Time to Maturity",
x = "Volatility (σ)",
y = "Option Price",
color = "Time to Maturity (T)"
) +
theme_minimal()
The option price increases with volatility (σ), as
higher uncertainty increases the likelihood of a profitable
payoff.
Longer times to maturity (T) result in higher option
prices due to the greater potential for the underlying asset to remain
above the barrier and the strike price.
In accordance with the Honor Code, I certify that my answers here are my own work, and I did not make my solutions available to anyone else.