FinancePy
FinancePy copied to clipboard
Issue of Bond payment dates
Hi, Dominic Bond._calculate_payment_dates() seems to have some problems.
from financepy.products.bonds.bond import Bond
from financepy.utils import Date, DayCountTypes, FrequencyTypes
bond = Bond(
issue_date=Date(7, 6, 2021),
maturity_date=Date(7, 6, 2031),
coupon=0.0341,
freq_type=FrequencyTypes.ANNUAL,
accrual_type=DayCountTypes.ACT_ACT_ISDA
)
bond._calculate_payment_dates()
print(bond._flow_amounts)
print(bond._coupon_dates)
print(bond._payment_dates)
The result is
[0.0, 0.0341, 0.0341, 0.0341, 0.0341, 0.0341, 0.0341, 0.0341, 0.0341, 0.0341, 0.0341]
[07-JUN-2021, 07-JUN-2022, 07-JUN-2023, 07-JUN-2024, 07-JUN-2025, 07-JUN-2026, 07-JUN-2027, 07-JUN-2028, 07-JUN-2029, 07-JUN-2030, 07-JUN-2031]
[07-JUN-2021, 09-JUN-2021, 09-JUN-2022, 09-JUN-2023, 10-JUN-2024, 09-JUN-2025, 09-JUN-2026, 09-JUN-2027, 09-JUN-2028, 11-JUN-2029, 10-JUN-2030, 09-JUN-2031]
Both flow_amounts and coupon_dates are correct. But payment_dates are strange.
What happens?