impliedRepoRateCalculator
First introduced in version: 3.00.6
Syntax
impliedRepoRateCalculator(futurePrice, cleanPrice, conversionFactor,
delivery, settlement, coupon, [frequency='Annual'],
[dayCountConvention='Actual365'], [couponDates])
Details
Calculates the implied repo rate (IRR) of bond futures to assess arbitrage opportunities between bond futures and deliverable bonds, and help identifying the cheapest-to-deliver (CTD) bond.
Parameters
futurePrice is a numeric scalar specifying the price of bond future (quoted per 100 of face value).
cleanPrice is a numeric scalar specifying the clean price of the deliverable bond (quoted per 100 of face value).
conversionFactor is a numeric scalar specifying the conversion factor of the deliverable bond.
delivery is a DATE scalar specifying the delivery date of the bond future.
settlement is a DATE scalar specifying the settlement date of the deliverable bond.
coupon is a numeric scalar or vector specifying the annual coupon rate. For example, 0.03 indicates a 3% annual coupon.
frequency (optional) is an INT scalar indicating the number of payments, or a STRING scalar indicating payment frequency. It can be:
-
"Annual" (default): Annual payments.
-
"Semiannual": Semi-annual payments.
dayCountConvention is a STRING scalar or vector indicating the day count convention to use. It can be:
-
"Actual365" (default): actual/365
-
"Actual360": actual/360
-
"ActualActualISMA": actual/actual (ISMA rule)
-
"ActualActualISDA": actual/actual (ISDA rule)
couponDates (optional) is a DATE vector specifying the scheduled coupon payment dates of the deliverable bond.
Returns
A DOUBLE scalar indicating the calculated IRR.
Examples
Calculate the IRR of a bond future.
// =====================================================
// I. Set the futures price and the cash bond price
// =====================================================
P_F = 108.725
P_S = 100.3729
// =====================================================
// II. Set the conversion factor
// =====================================================
CF = 0.9219
// =====================================================
// III. Set the delivery date and the settlement date
// =====================================================
delivery = 2026.09.15
settlement = 2026.04.23
// =====================================================
// IV. Set the coupon parameters of the deliverable bond
// =====================================================
coupon = 0.0166
freq = "Annual"
dcc = "Actual365"
couponDates = [
2026.03.25,
2027.03.25
]
// =====================================================
// V. Call the implied repo rate calculator
// =====================================================
actualIrr = impliedRepoRateCalculator(
P_F,
P_S,
CF,
delivery,
settlement,
coupon,
freq,
dcc,
couponDates
)
// =====================================================
// VI. Output the implied repo rate
// =====================================================
print("Calculator IRR: " + string(round(actualIrr * 100, 4)) + "%")
