Function Carry within
Bond with keys Bond Carry keys returns the at-the-money carry(ies) C of the referenced bond(s) between the bond settlement date and a horizon date , with Tˢ < Tᴴ and a given clean price (or prices) Pᶜ as of
is the bond settlement date as implied by a trade transaction assumed to occur on the
trade date T₀ (typically today).

C is defined like in Bloomberg, as follows:
C is the portion of the potential return from a trade that is attributed to the net income earned between the various payments that are received and paid out between and
In general, positive carry represents an attractive trade.

The carry is calculated by the formula:
C = yʰ - yˢ
is the bond's spot yield calculated as of the settlement date based on the supplied spot clean price Pᶜ as of
is the bond's forward yield calculated as of the horizon date based on an implied clean price as of , calculated out of an assumed repo rate r as described in the function
Fwd Clean Price

Note, this definition corresponds to the choice TRUE for the key
Clean Terms in the function Carry on objects of type IRS

Download the workbook
bond-carryroll.xlsx that demonstrates the method described here.