powered by
Compute bond price, cash flow table or duration
bond(ytm = 0.05, C = 0.05, T2M = 1, m = 2, output = "price")
Returns price numeric, cash flows tibble, or duration numeric
numeric
tibble
Yield to Maturity. numeric
Coupon rate per annum. numeric
Time to maturity in years. numeric
Periods per year for coupon payments e.g semi-annual = 2. numeric
"price", "df" or "duration". character
character
Philippe Cote
bond(ytm = 0.05, C = 0.05, T2M = 1, m = 2, output = "price") bond(ytm = 0.05, C = 0.05, T2M = 1, m = 2, output = "df") bond(ytm = 0.05, C = 0.05, T2M = 1, m = 2, output = "duration")
Run the code above in your browser using DataLab