Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions financepy/utils/bond_market.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def get_bond_market_conventions(country):
if country == BondMarkets.AUSTRIA:
return (act_act, annual, 2, 0, None)
if country == BondMarkets.AUSTRALIA:
return (act_act, annual, 2, 7, CalendarTypes.NONE)
return (act_act, semi_annual, 2, 7, CalendarTypes.NONE)
if country == BondMarkets.BELGIUM:
return (act_act, annual, 2, 0, None)
if country == BondMarkets.CYPRUS:
Expand Down Expand Up @@ -106,7 +106,7 @@ def get_bond_market_conventions(country):
if country == BondMarkets.NETHERLANDS:
return (act_act, annual, 2, 0, None)
if country == BondMarkets.NEW_ZEALAND:
return (act_act, annual, 2, 0, None)
return (act_act, semi_annual, 2, 0, None)
if country == BondMarkets.NORWAY:
return (thirty360, annual, 2, 2, None)
if country == BondMarkets.PORTUGAL:
Expand Down Expand Up @@ -140,7 +140,7 @@ def get_bond_market_conventions(country):
if country == BondMarkets.SWEDEN:
return (thirtye360, annual, 2, 0, None)
if country == BondMarkets.JAPAN:
return (act_act, annual, 2, 0, None)
return (act_act, semi_annual, 2, 0, None)
if country == BondMarkets.SWITZERLAND:
return (act_act, annual, 2, 0, None)
if country == BondMarkets.UNITED_STATES:
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/test_bond.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,3 +528,13 @@ def test_bond_us_treasury_final_period_uses_simple_interest():
settle_dt, treasury - bond.accrued_interest(settle_dt, 100.0), YTMCalcType.US_TREASURY
)
assert abs(ytm_back - ytm) < 1e-9


########################################################################################


def test_bond_market_semi_annual_coupons():

for country in (BondMarkets.AUSTRALIA, BondMarkets.JAPAN, BondMarkets.NEW_ZEALAND):
freq_type = get_bond_market_conventions(country)[1]
assert freq_type == FrequencyTypes.SEMI_ANNUAL
Loading