Back to Solved Problems
Hull, J. C. (2022). Options, Futures, and Other Derivatives (11th Ed.).
Chapter 6 - Interest Rate Futures.
question 7
Description
It is May 5, 2021. The quoted price of a government bond with a 12% coupon
that matures on July 27, 2034, is 110-17. What is the cash price?
Solution
Imports
from datetime import datetime
import math
import QuantLib
import pandas as pd
Code
def solve_question_7():
current_date = datetime(2021, 5, 5)
quoted_price = 110 + 17 / 32
maturity_date = datetime(2034, 7, 27)
coupon = 12
date_bgn = datetime(2021, 1, 27)
period1 = (current_date - date_bgn).days
date_end = datetime(2021, maturity_date.month, maturity_date.day)
period2 = (date_end - date_bgn).days
accrued_interest = (coupon / 2) * period1 / period2
cash_price = quoted_price + accrued_interest
return cash_price