# Price a call spread option with the following parameters:
F1 <- 100 # Forward price of first asset
F2 <- 110 # Forward price of second asset
X <- 5 # Strike price
sigma1 <- 0.2 # Volatility of first asset
sigma2 <- 0.25 # Volatility of second asset
rho <- 0.5 # Correlation between assets
T2M <- 1 # One year to maturity
r <- 0.05 # Risk-free rate
result_call <- spreadOption(F1, F2, X, sigma1, sigma2, rho, T2M, r, type = "call")
result_put <- spreadOption(F1, F2, X, sigma1, sigma2, rho, T2M, r, type = "put")
Run the code above in your browser using DataLab