Skip to content

Swap coupons grid issue #222

@vkul512

Description

@vkul512

Hi,

I found it very easy to create coupons grid issue when the starting date is 31th day, generation is backward, and maturities are expressed in months.
Due to irregularity in 30/31 days months maturity would fall to different days of the month and schedules would not coincide (see example below).
Do you have a recommended way of resolving it?

from financepy.market.curves import InterpTypes
from financepy.products.rates import IborDeposit, IborSingleCurve, IborSwap, DateGenRuleTypes
from financepy.utils import (
BusDayAdjustTypes,
Date,
DayCountTypes,
FrequencyTypes,
SwapTypes,
)

valuation_date = Date(31, 5, 2023)

swaps = []
for h in ['6M', '1Y']:
swaps.append(
IborSwap(
effective_dt=valuation_date,
term_dt_or_tenor=h,
fixed_leg_type=SwapTypes.PAY,
fixed_cpn=0.01,
fixed_freq_type=FrequencyTypes.QUARTERLY,
fixed_dc_type=DayCountTypes.ACT_360,
float_dc_type=DayCountTypes.ACT_360,
bd_type=BusDayAdjustTypes.NONE,
)
)

libor_curve = IborSingleCurve(
value_dt=valuation_date,
ibor_deposits=[],
ibor_fras=[],
ibor_swaps=swaps,
interp_type=InterpTypes.FLAT_FWD_RATES,
)

print('ok')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions