Forward and futures contracts - Financial Mathematics 1

Instructor: Dr. Le Nhat Tan

Author: Le Nguyen Dang Khoa

May 2023

1 Forward contracts

1.1 Example

Today is 1 March. A farmer enters a forward contract to sell 10,000 units of frozen peas on 1 September with the price $3 per unit.

  • What is the maturity date?
  • What is the time to maturity?
  • What is the delivery price?
# Given data
today <- as.Date("2023-03-01")
forward_price <- 3
units <- 10000

# Calculate maturity date
maturity_date <- as.Date("2023-09-01")
cat("Maturity date:", maturity_date, "\n")
## Maturity date: 19601
# Calculate time to maturity
time_to_maturity <- as.numeric(difftime(maturity_date, today, units = "days")) / 365
cat("Time to maturity:", round(time_to_maturity, 2), "years\n")
## Time to maturity: 0.5 years
# Calculate delivery price
delivery_price <- forward_price
cat("Delivery price:", delivery_price, "\n")
## Delivery price: 3

2 Delivery price for non-dividend paying asset

2.1 Practice

A farmer grows and freezes organically cultivated peas. He is worried that the price of peas might fall.

  • Today is 1 March and the current price for one unit of frozen peas is $3
  • Today, the farmer enters a forward contract to sell 10,000 units of frozen peas on 1 October. The interest rate is 10% per year, compounded monthly.
  • What should be the delivery price of the forward contract?
# Given data
current_price <- 3
interest_rate <- 0.1/12 # Monthly interest rate
time_to_delivery <- 7/12 # Time to delivery in years
quantity <- 10000

# Calculate the delivery price of the forward contract
delivery_price <- current_price * (1 + interest_rate)**(time_to_delivery*12)
delivery_price_per_unit <- delivery_price
cat("The delivery price of the forward contract should be: $", round(delivery_price_per_unit, 4), "\n")
## The delivery price of the forward contract should be: $ 3.1794

3 Delivery price for discrete dividend paying assets

3.1 Question 1

The price of a share is £6.75. The share pays no dividend. An investor enters a forward contract to sell one share in 14 months’ time. He can borrow money at 4.5% per year with interest compounded annually.

  • What is the delivery price on this contract?
  • Is the delivery higher or lower when the share paying dividends? Why?
# Given data
spot_price <- 6.75
interest_rate <- 0.045 # Annual interest rate
time_to_delivery <- 14/12 # Time to delivery in years

# Calculate the delivery price of the forward contract
delivery_price <- spot_price * (1 + interest_rate)**(time_to_delivery)
delivery_price_per_share <- delivery_price
cat("The delivery price on this contract is: £", round(delivery_price_per_share, 4), "\n")
## The delivery price on this contract is: £ 7.1057
# Assume the share pays a dividend of 1% per year
dividend_rate <- 0.01

# Calculate the delivery price of the forward contract when the share pays dividends
delivery_price_dividend <- (spot_price - (dividend_rate * spot_price)) / (1 + interest_rate)**(time_to_delivery)
delivery_price_per_share_dividend <- delivery_price_dividend
cat("The delivery price on this contract when the share pays dividends is: £", round(delivery_price_per_share_dividend, 4), "\n")
## The delivery price on this contract when the share pays dividends is: £ 6.348
## The delivery price when the share pays dividends is lower or equal.

3.2 Question 2

The price of a share is £8.69. The share is paying a dividend of 5% per year, every 6 months, with the first dividend due in the next two month. An investor enters a forward contract to buy 5000 shares in 18 months’ time. He can borrow money at 7.1% per year with semi-annual compounding. Calculate the 18-month forward price of the 5000 shares.

# Given data
spot_price <- 8.69
dividend_rate <- 0.05/2
time_to_dividend <- 2/12
time_to_expiry <- 18/12
interest_rate <- 0.071/2

# Calculate present value of dividends
pv_dividend_1 <- dividend_rate * spot_price * (1 + interest_rate)**(-time_to_dividend)
pv_dividend_1
## [1] 0.2159906
pv_dividend_2 <- dividend_rate * spot_price * (1 + interest_rate)**(-(time_to_dividend + 14/12))
pv_dividend_2
## [1] 0.2073766
pv_dividend_3 <- dividend_rate * spot_price * (1 + interest_rate)**(-(time_to_expiry))
pv_dividend_3
## [1] 0.2061743
pv_dividend_total <- pv_dividend_1 + pv_dividend_2+ pv_dividend_3
pv_dividend_total
## [1] 0.6295415
# Calculate forward price
forward_price <- (spot_price - pv_dividend_total) * (1 + interest_rate)**(time_to_expiry*2)
forward_price
## [1] 8.949733
forward_price_per_share <- forward_price
forward_price_total <- forward_price_per_share * 5000

cat("The 18-month forward price of the 5000 shares is: £", round(forward_price_total, 2), "\n")
## The 18-month forward price of the 5000 shares is: £ 44748.66

3.3 Question 3

Consider a 10-month forward contract on a stock when the stock price is $50. We assume that the risk-free rate of interest (continuously compounded) is 8% per annum for all maturities. We also assume that dividends of $0.75 per share are expected after 3 months, 6 months, and 9 months. What is the delivery of the forward contract?

# Given data
spot_price <- 50
dividend_rate <- 0.75
dividend_times <- c(3/12, 6/12, 9/12)
time_to_delivery <- 10/12
interest_rate <- 0.08

# Calculate the present value of dividends
present_value_dividends <- sum(dividend_rate * exp(-interest_rate * dividend_times))
present_value_dividends
## [1] 2.162064
# Calculate the delivery price
delivery_price <- (spot_price - present_value_dividends)*exp(interest_rate*time_to_delivery)

# Print the result
cat("The delivery price of the forward contract is: $", round(delivery_price, 2), "\n")
## The delivery price of the forward contract is: $ 51.14

3.4 Question 4

Consider a 6-month forward contract on an asset that is expected to provide income equal to 2% of the asset price once during a 6-month period. The risk-free rate of interest (with continuous compounding) is 10% per annum. The asset price is $25. What is the delivery of the forward contract?

# Given data
asset_price <- 25
income_rate <- 0.02
time_to_delivery <- 6/12
risk_free_rate <- 0.1

# Calculate the present value of income
present_value_income <- income_rate * asset_price * exp(-risk_free_rate * time_to_delivery)
present_value_income
## [1] 0.4756147
# Calculate the delivery price including the present value of income
delivery_price <- (asset_price - present_value_income)*exp(interest_rate*time_to_delivery)

# Print the result
cat("The delivery price of the forward contract is: $", round(delivery_price, 2), "\n")
## The delivery price of the forward contract is: $ 25.53

3.5 Question 5

Suppose the risk-free interest rate is 9% per year compounded continuously. A stock paying a dividend of 2,000 (VND) every 6 months (the first dividend payment is due in 2 months’ time) is valued at 114,000 (VND). The 15-month forward price on the stock is 120,000 (VND) per share. Is this an arbitrage opportunity? If so, how precisely would you respond to exploit the arbitrage opportunity?

# Interest rate and stock details
risk_free_rate <- 0.09
dividend <- 2000
stock_price <- 114000
forward_price_given <- 120000
t1 <- 2/12 # Time to first dividend (in years)
t2 <- 8/12 # Time to second dividend (in years)
t3 <- 14/12 # Time to third dividend (in years)
t_forward <- 15/12 # Time to forward contract expiry (in years)

# Calculate the present value of the dividends
PV_dividends <- dividend * exp(-risk_free_rate * t1) + dividend * exp(-risk_free_rate * t2) + dividend * exp(-risk_free_rate * t3)

# Calculate the no-arbitrage forward price
forward_price_theoretical <- (stock_price - PV_dividends) * exp(risk_free_rate * t_forward)

# Print the result
cat("Theoretical Forward Price:", forward_price_theoretical, "\n")
## Theoretical Forward Price: 121246.6
## Arbitrage opportunity exists. Here's how to exploit it:

## 1. Buy the stock today.
## 2. Enter a short position in a 15-month forward contract at the given forward price (120,000 VND).
## 3. Do not collect the dividends, as the seller of the stock does not receive them. Instead, use the proceeds from the short sale to invest at the risk-free rate.
## 4. At the forward contract expiry, sell the stock at the forward price and close your short position.
## 5. Profit from the difference between the theoretical and given forward prices.

3.6 Question 6

Suppose the risk-free interest rate is 10% per year compounded continuously. A stock paying a dividend of 7,000 (VND) every 6 months (the first dividend payment is due in 2 months’ time) is valued at 115,000 (VND). The 15-month forward price on the stock is 120,000 (VND) per share.

  1. Is this an arbitrage opportunity?

  2. If so, how precisely would you respond to exploit the arbitrage opportunity to earn at least 10 million VND?

3.6.1 1.

# Interest rate and stock details
risk_free_rate <- 0.10
dividend <- 7000
stock_price <- 115000
forward_price_given <- 120000
t1 <- 2/12 # Time to first dividend (in years)
t2 <- 8/12 # Time to second dividend (in years)
t3 <- 14/12 # Time to third dividend (in years)
t_forward <- 15/12 # Time to forward contract expiry (in years)

# Calculate the present value of the dividends
PV_dividends <- dividend * exp(-risk_free_rate * t1) + dividend * exp(-risk_free_rate * t2) + dividend * exp(-risk_free_rate * t3)

# Calculate the no-arbitrage forward price
forward_price_theoretical <- (stock_price - PV_dividends) * exp(risk_free_rate * t_forward)

# Print the result
cat("Theoretical Forward Price:", forward_price_theoretical, "\n")
## Theoretical Forward Price: 108032.1

3.6.2 2.

## Arbitrage opportunity exists. Here's how to exploit it:
## Number of shares needed to earn at least 10 million VND: 836 
## Formula: shares_needed = ceiling(10000000 / (forward_price_given - forward_price_theoretical))
## Profit per share: 11967.92 
## Formula: profit_per_share = forward_price_given - forward_price_theoretical

## 1. Short sell the stock today and invest the proceeds at the risk-free rate.
## 2. Do not collect the dividends, as the seller of the stock does not receive them. Instead, use the proceeds from the short sale to invest at the risk-free rate.
## 3. Enter a long position in a 15-month forward contract at the given forward price (120,000 VND).
## 4. At the forward contract expiry, buy the stock at the forward price and close your short position.
## 5. Profit from the difference between the theoretical and given forward prices.

4 Forward contracts for currencies

4.1 5.1 Case Study

The interest rate in the UK for a three-month loan is 6% per annum compounded annually. In Brazil, the interest rate for a three-month loan is 7.6%, compounded annually. The current exchange rate is £1=0.8824BR. What is the three-month forward price (in pounds) of one million Brazilian real?

# Interest rates and exchange rate
i_uk <- 0.06
i_br <- 0.076
current_exchange_rate <- 1 / 0.8824

# Time period in years
t <- 3 / 12

# Borrow in GBP at the UK interest rate
borrowed_gbp <- (1 + i_br)^(-t) * current_exchange_rate
borrowed_gbp
## [1] 1.112709
# Repay the loan at t = 3 months
repaid_gbp <- borrowed_gbp * (1 + i_uk)^(t)
repaid_gbp
## [1] 1.129036
# To avoid arbitrage, the three-month forward price of one Brazilian real in pounds should be equal to the repaid loan amount
forward_price <- repaid_gbp
# Print the result
cat("Three-Month Forward Price (GBP) of One Brazilian Real:", forward_price, "\n")
## Three-Month Forward Price (GBP) of One Brazilian Real: 1.129036

4.2 5.2: Practice

4.2.1 1.

The interest rate in the UK for a four-month loan is 6.05% per annum compounded continuously. In Japan, the interest rate for a four-month loan is 3.3%, compounded annually. The current exchange rate is £1 =187.4983 yen. What is the four-month forward price (in pounds) of one million yen?

# Spot exchange rate
S <- 187.4983

# Interest rates and time period
i_uk <- 0.0605
i_jp <- 0.033
t <- 4 / 12

# Borrow in yen at the Japan interest rate
borrowed_yen <- 1e6
borrowed_pounds <- borrowed_yen / S

# Invest the borrowed pounds in the UK at the UK interest rate
invested_pounds <- borrowed_pounds * exp(i_uk * t)

# Enter a forward contract to sell one million yen for £K
yen_to_sell <- borrowed_yen

# The value of the portfolio V0 = 0 (no initial investment)
V0 <- 0

# At t = T, repay the loan and hand over the yen
repay_loan_yen <- borrowed_yen * (1 + i_jp)^(t)
hand_over_yen <- yen_to_sell

# Receive £K from the forward contract
K <- invested_pounds

# The value of the portfolio: VT = K * S - repay_loan_yen
VT <- K * S - repay_loan_yen

# To avoid arbitrage, we must have VT = 0, or the forward price of one million yen in pounds should be equal to the repaid loan amount in yen
forward_price <- repay_loan_yen / S

# Print the result
cat("Four-Month Forward Price (GBP) of One Million Yen:", forward_price, "\n")
## Four-Month Forward Price (GBP) of One Million Yen: 5391.415

4.2.2 2.

Suppose that the risk-free interest rate in Vietnam is 9% per annum (compounded semi-annually), while the risk-free interest rate in the US is 4.78% per annum (compounded continuously). Today, the exchange rate for one USD is assumed to be: $1=22,800 (VND).

  1. Compute the theoretical six-month forward price (in VND) of one USD?
  2. Is there any arbitrage opportunity if the six-month forward price of one USD was 23,000 (VND)? If such an arbitrage opportunity exists, how precisely would you respond?
# Interest rates and exchange rate
i_vn_annual <- 0.09
i_us <- 0.0478
current_exchange_rate <- 22800

# Convert semi-annual compounding to continuous compounding
i_vn <- 2 * log(1 + i_vn_annual / 2)

# Time period in years
t <- 6 / 12

# Calculate forward exchange rate using interest rate parity formula
F <- current_exchange_rate * exp((i_vn - i_us) * t)

# Print the result
cat("Theoretical Six-Month Forward Price (VND) of One USD:", F, "\n")
## Theoretical Six-Month Forward Price (VND) of One USD: 23263.31
## Arbitrage opportunity exists. Here's how to exploit it:
## 1. Borrow in VND at the Vietnam interest rate.
## 2. Convert borrowed VND to USD using the spot exchange rate.
## 3. Invest the USD at the US interest rate.
## 4. Enter a forward contract to buy VND for USD at the given forward price (23,000 VND/USD).
## 5. At the end of six months, repay the borrowed VND using the forward contract.
## 6. Profit from the difference between the theoretical and given forward prices.

5 Forward price

5.1 Case study

A company knows it will have to buy 100,000 barrels of crude oil, in the market, in one month’s time.

The situation in the Middle East is turbulent and the company fears that the price of crude oil could rise considerably.

The market price, today, for one barrel of crude oil is $68.05 Assume the interest rate is r=7.85% per year compounded monthly.

The company enters a long one-month forward contract on 100,000 barrels of oil.

  1. What is the delivery price of this contract?

  2. After one week, the price of one barrel of oil has risen to $69.75. What is the three-week forward price for one barrel of this oil?

5.1.1 1.

# Given data
market_price <- 68.05
interest_rate <- 0.0785/12 # Monthly interest rate
time_to_delivery <- 1/12 # Time to delivery in years
time_to_3weeks <- (1/12)*(3/4) # Time to 3 weeks from delivery in years
oil_quantity <- 100000

# Calculate the delivery price of the forward contract
delivery_price <- market_price * (1+ interest_rate)**(time_to_delivery*12)
delivery_price_per_barrel <- round(delivery_price, 4)
delivery_price_per_barrel
## [1] 68.4952

5.1.2 2.

# Calculate the 3-week forward price
future_price <- 69.75 * (1+ interest_rate)**(time_to_3weeks*12)
future_price_per_barrel <- round(future_price, 4)
future_price_per_barrel
## [1] 70.0919
# Define the timeline
timeline <- c("Today", "Delivery of Oil", "3-Week Forward Contract Expiry")
timeline_values <- c(0, time_to_delivery, time_to_3weeks)

# Define the cash flows
cash_flows <- c(-delivery_price_per_barrel*oil_quantity, future_price_per_barrel*oil_quantity)

# Define cash flow labels
cash_flow_labels <- c("Buy Oil", "Delivery and Payment", "Sale of Oil")

# Plot the timeline and cash flows
plot(timeline_values, seq_along(timeline), type = "n", xlab = "Time (years)", ylab = "", main = "Oil Forward Contract Timeline")
text(timeline_values[2], seq_along(timeline)[2] + 0.2, paste("$", round(delivery_price_per_barrel, 2)), col = "red")
text(timeline_values[3], seq_along(timeline)[3] + 0.2, paste("$", round(future_price_per_barrel, 2)), col = "green")
arrows(timeline_values[1], 1, timeline_values[2], 1, col = "red", length = 0.1)
arrows(timeline_values[2], 1, timeline_values[3], 1, col = "green", length = 0.1)
text(timeline_values[c(1, 2)], rep(1.5, 2), cash_flow_labels[1], col = "red")
text(timeline_values[c(2, 3)], rep(1.5, 2), cash_flow_labels[3], col = "green")
abline(h = seq_along(timeline), lty = 3, col = "gray")
text(timeline_values, seq_along(timeline) - 0.2, timeline)

## Practice A company wishes to buy 200 ounces of gold in 3 months’ time. The interest rate is 4.9% per annum (continuously compounded). If the spot price for gold of this purity is $700 per ounce, find the three-month forward price of gold. One month later, the spot price is $701.5 per ounce. If the interest rate is unchanged, find, on this date, the two-month forward price of gold.

# Given data
gold_quantity <- 200
spot_price <- 700
interest_rate <- 0.049 # Continuously compounded interest rate
time_to_delivery_3m <- 3/12 # Time to delivery in years for the 3-month forward contract
time_to_delivery_2m <- 2/12 # Time to delivery in years for the 2-month forward contract
spot_price_1m <- 701.5 # Spot price after one month

# Calculate the 3-month forward price
forward_price_3m <- spot_price * exp(interest_rate * time_to_delivery_3m)
forward_price_3m_per_ounce <- forward_price_3m
cat("The 3-month forward price of gold is: $", round(forward_price_3m_per_ounce, 2), "per ounce\n")
## The 3-month forward price of gold is: $ 708.63 per ounce
# Calculate the 2-month forward price after 1 month
time_to_delivery_1m <- 1/12 # Time to delivery in years for the spot price after 1 month
forward_price_2m <- spot_price_1m * exp(interest_rate * (time_to_delivery_2m - time_to_delivery_1m))
forward_price_2m_per_ounce <- forward_price_2m
cat("The 2-month forward price of gold after 1 month is: $", round(forward_price_2m_per_ounce, 2), "per ounce\n")
## The 2-month forward price of gold after 1 month is: $ 704.37 per ounce

6 Value of a short position in forward contracts

6.1 Case study

Today is 8 March. ULS shares are selling today at $10.75

The share pays a dividend of 6% per year in two equal dividend payments, made on 8 April and 8 October. Stella wants to enter a forward contract to buy 1000 shares on 8 November. She can borrow money at 5% per year, compounded annually.

  1. Find the eight-month forward price on ULS shares.
  2. On 8 May, the share price has fallen to $9.25. On this day, what is the value of Stella’s forward contract?

6.1.1 1.

# Given data
spot_price <- 10.75
dividend_rate <- 0.03
time_to_dividend1 <- 1/12
time_to_dividend2 <- 7/12
time_to_maturity <- 8/12
interest_rate <- 0.05
quantity <- 1000

# Calculate the present value of dividends
pv_dividend1 <- dividend_rate * spot_price * (1 + interest_rate)**(-time_to_dividend1)
pv_dividend1
## [1] 0.3211914
pv_dividend2 <- dividend_rate * spot_price * (1 + interest_rate)**(-time_to_dividend2)
pv_dividend2
## [1] 0.3134507
# Calculate the eight-month forward price
forward_price <- (spot_price - pv_dividend1 - pv_dividend2) * (1 + interest_rate)**(time_to_maturity) 
forward_price_per_share <- forward_price
forward_price_total <- forward_price_per_share * quantity
cat("The eight-month forward price of the share is: $", round(forward_price_per_share, 4), "\n")
## The eight-month forward price of the share is: $ 10.4498

6.1.2 2.

# Given data
spot_price_2 <- 9.25
time_to_dividend <- (11-6)/12
time_to_expiry <- 6/12

# Calculate the present value of the dividend
pv_dividend <- dividend_rate * spot_price * (1 + interest_rate)**(-time_to_dividend)
pv_dividend
## [1] 0.31601
# Calculate the six-month forward price
forward_price_2 <- (spot_price_2 - pv_dividend) * (1 + interest_rate)**(time_to_expiry)
forward_price_per_share_2 <- forward_price_2
forward_price_total_2 <- forward_price_per_share_2 * quantity
cat("The six-month forward price of the share is: $", round(forward_price_per_share_2, 4), "\n")
## The six-month forward price of the share is: $ 9.1546
# Calculate the value of the long forward contract
value <- (forward_price_per_share_2 - forward_price_per_share) * (1 + interest_rate)**(-time_to_expiry)
value_total <- value * quantity
cat("The value of the long forward contract on 8 May is: $", round(value_total, 4), "\n")
## The value of the long forward contract on 8 May is: $ -1263.958

6.2 Practice

6.2.1 Exercise 1.

A long forward contract on a non-dividend-paying stock was entered into some time ago. It currently has 6 months to maturity, with the delivery price is $24. The risk-free rate of interest (with continuous compounding) is 10% per annum and the stock price is $25. What is the current value of the forward contract?

# Given data
spot_price <- 25
delivery_price <- 24
interest_rate <- 0.1
time_to_maturity <- 6/12

# Calculate the current value of the forward contract
current_value <- (spot_price - delivery_price) * exp(-interest_rate * time_to_maturity)

# Print the result
cat("The current value of the forward contract is: $", round(current_value, 2), "\n")
## The current value of the forward contract is: $ 0.95

6.2.2 Exercise 3.

Suppose an asset is currently worth $20 and the 6-month futures price of this asset is $22.50. By assuming the stock does not pay any dividends and the risk-free interest rate (compounded continuously) is the same for all maturities, calculate the 1-year futures price of this asset.

# Given data
spot_price <- 20
futures_price_6_months <- 22.50
time_to_maturity_6_months <- 6/12
time_to_maturity_1_year <- 1

# Calculate the risk-free interest rate (continuously compounded) using the futures price
interest_rate <- log(futures_price_6_months / spot_price) / time_to_maturity_6_months

# Calculate the 1-year futures price
futures_price_1_year <- spot_price * exp(interest_rate * time_to_maturity_1_year)

# Print the result
cat("The 1-year futures price of the asset is: $", round(futures_price_1_year, 2), "\n")
## The 1-year futures price of the asset is: $ 25.31

6.2.3 Exercise 4.

Let the current price of a stock be $12.75 that pays a continuous dividend yield \(\delta\). Suppose the risk-free interest rate is 6% per annum and the price of a 6-month forward contract is $13.25. Find \(\delta\).

# Given data
S <- 12.75  # Current price of the stock
F <- 13.25  # Price of 6-month forward contract
r <- 0.06   # Risk-free interest rate

# Calculate continuous dividend yield
delta <- (F/S - exp(r * 0.5)) / (exp(r * 0.5) - 1)
cat("The continuous dividend yield is:", delta)
## The continuous dividend yield is: 0.2876797

6.2.4 Exercise 5.

The interest rate is 7.3% compounded annually. A stock paying a dividend of $2.50 every six months (the next dividend payment is due in three months’ time) is valued at $35. The six-month forward price on the stock is $34. Is this an arbitrage opportunity? If so, how precisely would you respond?

# Given data
spot_price <- 35
forward_price <- 34
interest_rate <- 0.073
dividend_rate <- 2.5
time_to_dividend <- 0.25
time_to_expiry <- 0.5

# Calculate the theoretical forward price
theoretical_forward_price <- (spot_price - dividend_rate * exp(-interest_rate * time_to_dividend)) * exp(interest_rate * time_to_expiry)

cat("Theoretical forward price is: $", round(theoretical_forward_price, 2), "\n")
## Theoretical forward price is: $ 33.76
cat("Forward price is: $", forward_price, "\n")
## Forward price is: $ 34
# Check for arbitrage opportunity
if (forward_price < theoretical_forward_price) {
  cat("There is an arbitrage opportunity.\n")
  # Determine the arbitrage strategy
  # Sell the underlying asset
  cash_inflow <- spot_price
  # Buy the forward contract
  cash_outflow <- forward_price
  # Borrow the difference at risk-free rate
  cash_inflow <- cash_inflow - cash_outflow
  cash_inflow <- cash_inflow * exp(interest_rate * time_to_expiry)
  # Net cash flow
  net_cash_flow <- cash_outflow - cash_inflow
  cat("The net cash flow is: $", round(net_cash_flow, 2), "\n")
} else if (forward_price > theoretical_forward_price) {
  cat("There is an arbitrage opportunity.\n")
  # Determine the arbitrage strategy
  # Buy the underlying asset
  cash_outflow <- spot_price - dividend_rate * exp(-interest_rate * time_to_dividend)
  # Sell the forward contract
  cash_inflow <- theoretical_forward_price
  # Invest the proceeds in a risk-free asset
  # cash_outflow <- cash_outflow * exp(interest_rate * time_to_expiry)
  # Net cash flow
  net_cash_flow <- cash_inflow - cash_outflow
  cat("The net cash flow is: $", round(net_cash_flow, 2), "\n")
} else {
  cat("There is no arbitrage opportunity.\n")
}
## There is an arbitrage opportunity.
## The net cash flow is: $ 1.21

6.2.5 Exercise 6.

The interest rate in London is 4.35% per year compounded annually. In Cyprus, the interest rate is 6.16% (compounded annually). One Cypriot pound (CYP) = £1.20. In four months’ time, how many pounds might I expect to buy for 10 000 CYP?

# Given data
interest_rate_london <- 0.0435
interest_rate_cyprus <- 0.0616
exchange_rate_cyp_to_gbp <- 1.20
time_to_maturity <- 4/12

# Calculate the forward exchange rate
forward_exchange_rate <- exchange_rate_cyp_to_gbp * (1 + interest_rate_london)^time_to_maturity / (1 + interest_rate_cyprus)^time_to_maturity

# Calculate the amount of pounds that can be bought with 10,000 CYP
pounds <- 10000 * forward_exchange_rate

# Print the result
cat("The amount of pounds that can be bought with 10,000 CYP in four months is:", round(pounds, 2), "\n")
## The amount of pounds that can be bought with 10,000 CYP in four months is: 11931.41

6.2.6 Exercise 7.

The interest rate in the UK is 4.87% (compounded annually). Today, £1 $= 3767.676 $ Belarus rubles (BYR). The six-month forward price on the BYR is £1 =3925.831BYR. Estimate the interest rate (annually compounded) in Belarus.

# Given information
i_uk <- 0.0487
current_exchange_rate <- 3767.676
forward_exchange_rate <- 3925.831
t <- 6/12

# Calculate the interest rate in Belarus (annual compounding)
i_byr <- ((forward_exchange_rate/current_exchange_rate)^(1/t) - 1)

# Print the result
cat("The interest rate in Belarus is:", round(i_byr, 4) * 100, "% (annually compounded)\n")
## The interest rate in Belarus is: 8.57 % (annually compounded)

6.2.7 Exercise 8:

The interest rate in the UK is 4.87% (compounded annually). Today, £1 $= 3767.676 $ Belarus rubles (BYR). The six-month forward price on the BYR is £1 =3925.831BYR. Estimate the interest rate (annually compounded) in Belarus.

spot_exchange_rate <- 3767.676
forward_exchange_rate <- 3925.831
domestic_interest_rate <- 0.0487

foreign_interest_rate <- (spot_exchange_rate * (1 + domestic_interest_rate) / forward_exchange_rate) - 1

foreign_interest_rate
## [1] 0.006452346

6.3 Book problems Bill Halton 2:

6.3.1 Page 104

6.3.1.1 Exercise 2:

A bushel of corn is valued today at $3.49. The annual safe rate is 6.3% (compounded annually). A forward contract is entered to sell the corn in four months’ time. What is the delivery price in the contract?

# Given data
spot_price <- 3.49
interest_rate <- 0.063
time_to_delivery <- 4/12

# Calculate the delivery price
delivery_price <- spot_price * (1 + interest_rate)^time_to_delivery

# Print the result
cat("The delivery price in the forward contract is: $", round(delivery_price, 2), "\n")
## The delivery price in the forward contract is: $ 3.56

6.3.1.2 Exercise 3:

An ounce of gold today is priced at $110.70. The interest rate is 5.8% (compounded twice yearly). A forward contract is entered to buy 20 ounces of gold in three months’ time. What is the delivery price in this contract?

# Given data
spot_price <- 110.70
interest_rate <- 0.058/2
time_to_delivery <- 3/12
No_contract = 20

# Calculate the delivery price
delivery_price <- No_contract* spot_price * (1 + interest_rate)^time_to_delivery

# Print the result
cat("The delivery price in the forward contract is: $", round(delivery_price, 2), "\n")
## The delivery price in the forward contract is: $ 2229.88

6.3.2 Page 105

6.3.2.1 Exercise 5:

An asset is valued today at $20.00. What is meant by the three-month forward price of the asset? How is the three-month forward price calculated?

# Given data
spot_price <- 20.00
interest_rate <- 0.045
time_to_delivery <- 3/12

# Calculate the three-month forward price
forward_price <- spot_price * (1 + interest_rate)^time_to_delivery

# Print the result
cat("The three-month forward price of the asset is: $", round(forward_price, 2), "\n")
## The three-month forward price of the asset is: $ 20.22

6.3.2.2 Exercise 6:

Bebop share is valued today at £10.50. The interest rate is 7.2%, compounded continuously. Find

  1. the four-month forward price,

  2. the six-month forward price on a Bebop share. I enter a six-month forward contract on Bebop shares. What is the delivery price in this contract?

Answer (i) The four-month forward price can be calculated as follows:

# Given data
spot_price <- 10.50
interest_rate <- 0.072
time_to_delivery_1 <- 4/12

# Calculate the four-month forward price
forward_price_1 <- spot_price * exp(interest_rate * time_to_delivery_1)

# Print the result
cat("The four-month forward price of a Bebop share is: £", round(forward_price_1, 2), "\n")
## The four-month forward price of a Bebop share is: £ 10.76
  1. The six-month forward price can be calculated using a similar approach:
# Given data
time_to_delivery_2 <- 6/12

# Calculate the six-month forward price
forward_price_2 <- spot_price * exp(interest_rate * time_to_delivery_2)

# Print the result
cat("The six-month forward price of a Bebop share is: £", round(forward_price_2, 2), "\n")
## The six-month forward price of a Bebop share is: £ 10.88

6.3.2.3 Exercise 7:

A football team is valued at £35 million. Things have not been going too well and the owner decides to sell the team at the end of the season, four months away. He enters a forward contract to sell the team in four months’ time. The interest rate is 4.8% per year, compounded semi-annually.

  1. What is the delivery price on this forward contract? What is the four month forward price on the team?

  2. One month later, the team is valued at £32.5 million.

(a) What is the delivery price in the forward contract in part (i)?
(b) What is the three-month forward price of the team?
# Given data
spot_price <- 35
interest_rate <- 0.048
number_of_periods <- 4/12

# Calculate the delivery price
delivery_price <- spot_price / (1 + (interest_rate / 2))^(number_of_periods)
cat("The delivery price on the forward contract is: £", round(delivery_price, 2), "\n")
## The delivery price on the forward contract is: £ 34.72
# Calculate the four-month forward price
forward_price <- spot_price * (1 + (interest_rate / 2))^number_of_periods
cat("The four-month forward price on the team is: £", round(forward_price, 2), "\n")
## The four-month forward price on the team is: £ 35.28
# Update the spot price
spot_price_updated <- 32.5

# Calculate the three-month forward price
number_of_periods_2 <- number_of_periods - 1/12
forward_price_2 <- spot_price_updated * (1 + (interest_rate / 2))^number_of_periods_2
cat("The three-month forward price of the team is: £", round(forward_price_2, 2), "\n")
## The three-month forward price of the team is: £ 32.69

6.3.2.4 Exercise 8:

A one-year forward contract to buy a non-dividend-paying stock is entered when the price of the stock is £15. The risk-free interest rate is 7.5% per year with continuous compounding.

  1. What is the initial value of the forward contract?

  2. What is the one-year forward price on the stock?

  3. In six months’ time, the stock is trading at £17.70 and the interest rate is unchanged. What is the delivery price on the original forward contract? What is the six-month forward price on the stock?

# Given data
spot_price <- 15
interest_rate <- 0.075
time_to_expiry <- 1

# (i) Calculate the initial value of the forward contract
initial_value <- spot_price * exp(interest_rate * time_to_expiry)
cat("The initial value of the forward contract is: £", round(initial_value, 2), "\n")
## The initial value of the forward contract is: £ 16.17
# (ii) Calculate the one-year forward price on the stock
forward_price <- spot_price * exp(interest_rate * time_to_expiry)
cat("The one-year forward price on the stock is: £", round(forward_price, 2), "\n")
## The one-year forward price on the stock is: £ 16.17
# Update the spot price and time to expiry
spot_price_updated <- 17.70
time_to_expiry_updated <- 0.5

# (iii) Calculate the delivery price on the original forward contract
delivery_price <- spot_price_updated * exp(-interest_rate * time_to_expiry_updated)
cat("The delivery price on the original forward contract is: £", round(delivery_price, 2), "\n")
## The delivery price on the original forward contract is: £ 17.05
# Calculate the six-month forward price on the stock
forward_price_updated <- spot_price_updated * exp(interest_rate * time_to_expiry_updated)
cat("The six-month forward price on the stock is: £", round(forward_price_updated, 2), "\n")
## The six-month forward price on the stock is: £ 18.38

6.3.2.5 Exercise 9:

A six-month forward contract to buy a non-dividend-paying stock (a long forward contract) is entered when the stock sells at £18.50. The current safe interest rate is 8.7% per year compounded annually.

  1. What is the six-month forward price on the stock?

  2. After one month, the stock is valued at £19.98. What is the five-month forward price? What, today, is the value of the forward contract?

  3. One month later, the stock was selling at £19.50. Calculate the four month forward price. What is now the value of the forward contracts?

# Given data
spot_price <- 18.50
interest_rate <- 0.087
time_to_expiry <- 0.5

# (i) Calculate the six-month forward price on the stock
forward_price_6m <- spot_price * exp(interest_rate * time_to_expiry)
cat("The six-month forward price on the stock is: £", round(forward_price_6m, 2), "\n")
## The six-month forward price on the stock is: £ 19.32
# Update the spot price and time to expiry
spot_price_updated_1m <- 19.98
time_to_expiry_updated_5m <- 0.5 - 1/12

# (ii) Calculate the five-month forward price
forward_price_5m <- spot_price_updated_1m * exp(interest_rate * time_to_expiry_updated_5m)
cat("The five-month forward price on the stock is: £", round(forward_price_5m, 2), "\n")
## The five-month forward price on the stock is: £ 20.72
# Calculate the value of the forward contract today
forward_contract_value_today <- (forward_price_6m - spot_price) * exp(interest_rate * time_to_expiry)
cat("The value of the forward contract today is: £", round(forward_contract_value_today, 2), "\n")
## The value of the forward contract today is: £ 0.86
# Update the spot price and time to expiry
spot_price_updated_2m <- 19.50
time_to_expiry_updated_4m <- 0.5 - 2/12

# (iii) Calculate the four-month forward price
forward_price_4m <- spot_price_updated_2m * exp(interest_rate * time_to_expiry_updated_4m)
cat("The four-month forward price on the stock is: £", round(forward_price_4m, 2), "\n")
## The four-month forward price on the stock is: £ 20.07
# Calculate the value of the forward contract after two months
forward_contract_value_2m <- (forward_price_4m - spot_price) * exp(interest_rate * time_to_expiry_updated_4m)
cat("The value of the forward contract after two months is: £", round(forward_contract_value_2m, 2), "\n")
## The value of the forward contract after two months is: £ 1.62

6.3.2.6 Exercise 10:

An asset pays a dividend of £5.50 twice each year. The first dividend payment is due in one month’s time. The asset is valued at £150. If the interest rate is 6% per year (compounded annually), find the delivery price in a forward contract with delivery date in one year’s time.

# Given data
dividend_1 <- 5.50
dividend_2 <- 5.50
dividend_times <- c(1/12, 7/12)
asset_price <- 150
interest_rate <- 0.06
time_to_delivery <- 1

# Calculate the present value of dividends
pv_dividend_1 <- dividend_1 * (1 + interest_rate)^(-dividend_times[1])
pv_dividend_2 <- dividend_2 * (1 + interest_rate)^(-dividend_times[2])

# Calculate the delivery price
delivery_price <- (asset_price - pv_dividend_1 - pv_dividend_2) * (1 + interest_rate)^time_to_delivery

# Print the result
cat("The delivery price in the forward contract is: £", round(delivery_price, 3), "\n")
## The delivery price in the forward contract is: £ 147.563

6.3.3 page 106 (11-14)

6.3.3.1 Exercise 11:

A share is priced today at £10.00. The share pays a dividend of 5% per year, in two equal instalments: the first dividend payment is due in four months’ time. The interest rate is 6% per year, continuously compounded. I enter a forward contract on the share with delivery date in 14 months’ time. Find the delivery price?

# Given data
share_price <- 10.00
dividend_rate <- 0.05/2
dividend_times <- c(4/12, 10/12)
interest_rate <- 0.06
time_to_delivery <- 14/12

# Calculate the present value of dividends
pv_dividend_1 <- share_price * dividend_rate * exp(-interest_rate * dividend_times[1])
pv_dividend_2 <- share_price * dividend_rate * exp(-interest_rate * dividend_times[2])

# Calculate the delivery price
delivery_price <- (share_price - pv_dividend_1 - pv_dividend_2) * exp(interest_rate * time_to_delivery)

# Print the result
cat("The delivery price in the forward contract is: £", round(delivery_price, 4), "\n")
## The delivery price in the forward contract is: £ 10.2072

6.3.3.2 Exercise 12:

An asset is valued today at $20.00. The asset pays a dividend of $1 twice each year. The first dividend is due in three months’ time. The interest rate is 6.5% per year compounded continuously. A ten-month short forward contract is entered.

  1. What is the ten-month forward price and what, today, is the value of the contract?

  2. One month later, the value of the stock has fallen to $17. What is the nine-month forward price on the stock and what is now the value of the forward contract?

  3. After a further month, the stock is selling at $25. What is the eight month forward price and what is the value of the forward contract?

# Given data
spot_price <- 20.00
dividend_rate <- 0.01
dividend_times <- c(3/12, 6/12)
interest_rate <- 0.065
time_to_delivery <- 10/12

# Calculate the present value of dividends
pv_dividend_1 <- spot_price * dividend_rate * exp(-interest_rate * dividend_times[1])
pv_dividend_2 <- spot_price * dividend_rate * exp(-interest_rate * dividend_times[2])

# Calculate the ten-month forward price and value of the contract today
forward_price_10 <- (spot_price - pv_dividend_1 - pv_dividend_2) * exp(interest_rate * time_to_delivery)
value_today <- 0

# Print the results
cat("The ten-month forward price is: $", round(forward_price_10, 5), "\n")
## The ten-month forward price is: $ 20.7011
cat("The value of the contract today is: $", round(value_today, 2), "\n")
## The value of the contract today is: $ 0
# Update the spot price
spot_price_updated <- 17

# Calculate the nine-month forward price and value of the contract
forward_price_9 <- (spot_price_updated - pv_dividend_1 - pv_dividend_2) * exp(interest_rate * (time_to_delivery - 1/12))
value_9 <- forward_price_9 - forward_price_10 * exp(interest_rate * 1/12)

# Print the results
cat("The nine-month forward price is: $", round(forward_price_9, 5), "\n")
## The nine-month forward price is: $ 17.4394
cat("The value of the forward contract after one month is: $", round(value_9, 2), "\n")
## The value of the forward contract after one month is: $ -3.37
# Update the spot price
spot_price_updated <- 25

# Calculate the eight-month forward price and value of the contract
forward_price_8 <- (spot_price_updated - pv_dividend_1 - pv_dividend_2) * exp(interest_rate * (time_to_delivery - 2/12))
value_8 <- forward_price_8 - forward_price_10 * exp(interest_rate * 2/12)

# Print the results
cat("The eight-month forward price is: $", round(forward_price_8, 5), "\n")
## The eight-month forward price is: $ 25.69948
cat("The value of the forward contract after two months is: $", round(value_8, 2), "\n")
## The value of the forward contract after two months is: $ 4.77

6.3.3.3 Exercise 13:

The interest rate is 7.3% compounded annually. A stock paying a dividend of £2.50 every six months (the next dividend payment is due in three months’ time) is valued at £35. The six-month forward price on the stock is £34.00. Is this an arbitrage opportunity? If so, how precisely would you respond?

Answer: In this case, the delivery price is calculated to be £33.71, while the six-month forward price on the stock is £34.00. Since the delivery price is not equal to the forward price, there is an arbitrage opportunity.

To respond to this arbitrage opportunity, one could consider the following steps:

  1. Borrow money at the risk-free interest rate.
  2. Use the borrowed money to buy the stock.
  3. Enter into a forward contract to sell the stock at the delivery price. 4.Wait for the delivery date.
  4. Deliver the stock and receive the agreed-upon delivery price.
  5. Repay the borrowed money with the received amount.
  6. Keep the remaining profit, which is the difference between the forward price and the delivery price.

By executing these steps, one can exploit the arbitrage opportunity and make a riskless profit.

6.3.3.4 Exercise 14:

The interest rate in the UK is 4.8% per year compounded continuously. The interest rate in the US is 5.3% per year, compounded continuously. Today, £1 = $1.87. Calculate, in pounds, the six-month forward price of the dollar. Why is the six-month forward price of the dollar less than the spot price?

# Given data
spot_price = 1.87
interest_rate_uk = 0.048
interest_rate_us = 0.053
time_to_delivery = 6/12

# Calculate the forward price of the dollar
forward_price = spot_price * (2.71828**(-interest_rate_us*time_to_delivery)) * (2.71828**(interest_rate_uk*time_to_delivery))

# Print the result
print("The six-month forward price of the dollar:", forward_price)
## [1] "The six-month forward price of the dollar:"

6.3.3.5 Exercise 16:

The interest rate in London is 4.35% per year compounded annually. In Cyprus, the interest rate is 6.16% (compounded annually). One Cypriot pound (CYP) = £1.1981. In four months’ time, how many pounds might I expect to buy for 10 000 CYP?

# Given data
interest_rate_london = 0.0435
interest_rate_cyprus = 0.0616
exchange_rate = 1.1981
time_to_delivery = 4 / 12

# Borrowing in London
borrowed_amount = (1 + interest_rate_cyprus)**(-time_to_delivery) * exchange_rate

# Buying CYP
buying_amount = (1 + interest_rate_cyprus)**(time_to_delivery) * 10000

# Value of the portfolio
portfolio_value = -borrowed_amount + buying_amount

# Repaying the loan
repayment_amount = borrowed_amount * (1 + interest_rate_london)**(time_to_delivery)

# Calculate the pound amount
pound_amount = repayment_amount * 10000

pound_amount
## [1] 11912.52

6.3.3.6 Exercise 17:

In Australia, the interest rate is 4.23% (compounded continuously). The interest rate in the US is 4.78% (compounded continuously). Today, one Australian dollar (AUD) = $0.7632. Describe carefully what a currency dealer in New York might do if the six-month forward price of the AUD was

(i) \$0.7700, 
(ii) $0.7600.
# Given data
interest_rate_aud <- 0.0423
interest_rate_usd <- 0.0478
spot_price <- 0.7632
forward_price_1 <- 0.7700
forward_price_2 <- 0.7600

# Borrow AUD in New York
borrowed_amount <- spot_price * exp(interest_rate_aud * (-0.5))

# Buy AUD with the borrowed money
buying_amount <- exp(interest_rate_aud * (-0.5))

# Value of the portfolio
portfolio_value_1 <- forward_price_1 - borrowed_amount
portfolio_value_2 <- forward_price_2 - borrowed_amount

# Repay the loan
repayment_amount <- borrowed_amount * exp(interest_rate_usd * 0.5)

# Calculate the value of the portfolio at T
portfolio_value_T_1 <- repayment_amount - forward_price_1
portfolio_value_T_2 <- repayment_amount - forward_price_2

# Determine the trading position based on portfolio values
if (portfolio_value_T_1 > 0) {
  cat("The six-month forward price of the AUD was $0.7700. The New York dealer should be in a long position.\n")
} else {
  cat("The six-month forward price of the AUD was $0.7700. The New York dealer should be in a short position.\n")
}
## The six-month forward price of the AUD was $0.7700. The New York dealer should be in a short position.
if (portfolio_value_T_2 > 0) {
  cat("The six-month forward price of the AUD was $0.7600. The New York dealer should be in a long position.\n")
} else {
  cat("The six-month forward price of the AUD was $0.7600. The New York dealer should be in a short position.\n")
}
## The six-month forward price of the AUD was $0.7600. The New York dealer should be in a long position.

6.3.3.7 Exercise 18:

BBR is a company which was a late arrival on the BBQ scene. The BBR share price today is £5.70 and the company will pay a dividend of 2% of today’s share price in three months and again in nine months. The interest rate is 4.5% compounded quarterly.

# Given data
share_price_today <- 5.70
dividend_rate <- 0.02
interest_rate_quarterly <- 0.045

# Calculate the continuously compounded annual rate for the safe interest rate
interest_rate_continuous <- exp(interest_rate_quarterly) - 1
# Calculate the continuously compounded rate for the two dividend payments
dividend_rate_continuous <- exp(2 * log(1 + dividend_rate)) - 1

# Calculate the one-year forward price
forward_price <- share_price_today * exp(interest_rate_continuous - dividend_rate_continuous)

# Print the result
cat("The one-year forward price of the BBR share is: ", round(forward_price, 4), "\n")
## The one-year forward price of the BBR share is:  5.7322

6.3.3.8 Exercise 19:

Polyfew chemical shares cost, today, £15.50. The shares pay an annual dividend of 6% in two six-monthly dividend payments. The next dividend is to be paid in four months’ time. It is thought that next year the annual dividend will be 6.1%. (Assume the share price next year remains at £15.50.) The interest rate is 5.5% compounded annually. Use the formulas (i) (S0 − D)(1 + R)T for discrete dividend payments, and (ii) S0e(R−Q)T with equivalent continuously compounded rates to calculate the 18-month forward price on the shares.

# Given data
share_price_today <- 15.50
dividend_rate_1 <- 0.06/2
dividend_rate_2 <- 0.061/2
dividend_rate_3 <- 0.061/2
interest_rate <- 0.055
time_to_dividend_1 <- 4/12
time_to_dividend_2 <- 10/12
time_to_dividend_3 <- 16/12
time_to_expiry <- 18/12

# Calculate the present value of dividend payments
pv_dividend_1 <- dividend_rate_1 * share_price_today * (1 + interest_rate)^(-time_to_dividend_1)
pv_dividend_2 <- dividend_rate_2 * share_price_today * (1 + interest_rate)^(-time_to_dividend_2)
pv_dividend_3 <- dividend_rate_3 * share_price_today * (1 + interest_rate)^(-time_to_dividend_3)

# Calculate the forward price using discrete dividend formula
forward_price_discrete <- (share_price_today - pv_dividend_1 - pv_dividend_2 - pv_dividend_3) * (1 + interest_rate)^time_to_expiry

# Calculate the continuously compounded rate for the dividend payments
dividend_rate_continuous <- exp(2 * log(1 + dividend_rate_3)) - 1

# Calculate the forward price using continuous dividend formula
forward_price_continuous <- share_price_today * exp(interest_rate - dividend_rate_continuous) * exp(-dividend_rate_continuous * time_to_expiry)

# Print the results
cat("The 18-month forward price on the shares using discrete dividend formula: £", round(forward_price_discrete, 2), "\n")
## The 18-month forward price on the shares using discrete dividend formula: £ 15.33
cat("The 18-month forward price on the shares using continuous dividend formula: £", round(forward_price_continuous, 2), "\n")
## The 18-month forward price on the shares using continuous dividend formula: £ 14.03

6.3.3.9 Exercise 20:

The interest rate in the UK is 4.87% (compounded annually). Today, £1 = 3767.676 Belarus rubles (BYR). The six-month forward price on the BYR is £1 = 3925.831 BYR. Estimate the interest rate (annually compounded) in Belarus.

# Given data
exchange_rate_today <- 3767.676
forward_rate_six_months <- 3925.831
interest_rate_UK <- 0.0487
time_to_delivery <- 6/12

# Calculate the borrowed amount in BYR
borrowed_amount_BYR <- (1 + interest_rate_UK)^(-time_to_delivery) * exchange_rate_today

# Calculate the interest rate in Belarus
interest_rate_Belarus <- (forward_rate_six_months / borrowed_amount_BYR)^(1/time_to_delivery) - 1

# Print the result
cat("The estimated interest rate in Belarus (annually compounded) is:", round(interest_rate_Belarus, 4), "\n")
## The estimated interest rate in Belarus (annually compounded) is: 0.1386

6.3.3.10 Exercise 22:

An asset is valued today at £55.00. The asset pays a dividend of £2.50 every six months, with the first dividend due in two months’ time. The interest rate is 5.0%, compounded continuously.

Calculate the 12-month forward price of the asset. A long 12-month forward contract on the asset (the delivery price is the 12-month forward price) is entered today. What is the value of this forward contract today?

The value of the asset in one month’s time, two months’ time and so on are given in the table below. Calculate the value of the forward contract described in (i) on each of these dates. Draw a graph of the value of the forward contract against asset value.

# Given data
asset_price_today <- 55.00
dividend_payment <- 2.50
time_to_dividend <- 2/12
interest_rate <- 0.05

# Calculate the present value of the first dividend payment
present_value_dividend_1 <- dividend_payment * exp(-interest_rate * time_to_dividend)

# Calculate the present value of the second dividend payment
present_value_dividend_2 <- dividend_payment * exp(-interest_rate * (time_to_dividend + 6/12))

# Calculate the borrowed amount for the forward contract
borrowed_amount <- asset_price_today - present_value_dividend_1 - present_value_dividend_2

# Calculate the 12-month forward price
forward_price <- borrowed_amount * exp(interest_rate * 1)

# Calculate the value of the forward contract today
forward_contract_value_today <- forward_price - borrowed_amount

# Print the results
cat("The 12-month forward price of the asset is: £", round(forward_price, 2), "\n")
## The 12-month forward price of the asset is: £ 52.67
cat("The value of the forward contract today is: £", round(forward_contract_value_today, 2), "\n")
## The value of the forward contract today is: £ 2.57