Objective

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.

Assumptions

  1. Option Characteristics:
    • The option is a European-style down-and-out call option.
    • The option is active from the time of pricing until expiry, and it gets canceled if the price of the underlying asset breaches the barrier.
  2. Monte Carlo Simulation:
    • The number of Monte Carlo iterations (n_sim) is set to 10,000 to ensure statistical accuracy.
    • Daily time steps (dt) are used, assuming 252 trading days in a year.
  3. Input Parameters:
    • The initial price of the underlying asset (S0) is fixed at 105.
    • The strike price of the option (K) is fixed at 110.
    • The annualized risk-free interest rate (r) is 5%.
    • The barrier level (L) is set at 100.
    • The volatility range is explored between 15% and 30%.
    • The time to maturity is varied between 0.25 years and 1 year.

Installation

# install.packages("/Users/paidamoyo/Desktop/optionpricer_0.1.0.tar.gz", repos = NULL, type = "source")
library(optionpricer)
library(ggplot2)

Option Characteristics

The down-and-out call option is priced based on the following parameters:

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)

Results and Visualization

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()

Conclusions

  1. The option price increases with volatility (σ), as higher uncertainty increases the likelihood of a profitable payoff.

  2. 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.

Declaration

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.