Skip to content

BUG? _dcf_actacticma with leap year  #144

@shh6242

Description

@shh6242

Bill.dcf attribute throws large dcf years when using convention ActActICMA.
I think the problem is the effective date of 29th Feb 2024.

Could you please see if _dcf_actacticma working well for the leap year?

Replicate code as below,

from rateslib import Bill
from datetime import datetime as dt

bill_actacticma = Bill(
    effective= dt(2024, 2, 29),
    termination= dt(2024, 5, 29),   # 90 calendar days
    modifier='NONE',
    calendar= 'bus',
    payment_lag= 0,
    notional=-1000000,
    currency='usd',
    convention='ACTACTICMA',        
    settle=0, 
    calc_mode='ustb', 
)

bill_act360 = Bill(
    effective= dt(2024, 2, 29),
    termination= dt(2024, 5, 29),   # 90 calendar days
    modifier='NONE',
    calendar= 'bus',
    payment_lag= 0,
    notional=-1000000,
    currency='usd',
    convention='ACT360',        
    settle=0, 
    calc_mode='ustb', 
)

print(bill_actacticma.dcf)  # 8333333.333333333
print(bill_act360.dcf)        # 0.25

thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions