bond <- fixed_bond(
value_date = 210101,
mty_date = c(250101, 300201),
redem_value = 100,
cpn_rate = c(0.05, 0.03),
cpn_freq = c(0, 1)
)
bond$ytm_dur(
ref_date = c(220101, 220201),
clean_price = 100
)
bond$cf(
ref_date = c(220101, 220131)
)
Run the code above in your browser using DataLab