disentcorp / dateroll

dateroll makes working with 📅 dates less painful.
Apache License 2.0
11 stars 1 forks source link

Daycount fractions for minimal support on ratecurve #10

Open disentchris opened 2 months ago

disentchris commented 2 months ago

Is your feature request related to a problem? Please describe. Part of roadmap Describe the solution you'd like In rate curve right now I overage Duration,yf and Duration.just_bds:

Duration.just_bds = lambda self, *args, **kwargs: self.just_days
Duration.yf = lambda self, *args, **kwargs: self.just_days / 365

Additional context Here's how I use them

(validated_date - validated_root).just_bds(cal=cal, dc=dc)
(validated_date2 - validated_date1).yf(cal, dc)
amalizzio commented 2 months ago

I will add the 3 simple ones:

ACT/365 (aka ACT/365F or ACT/365 FIXED where actuals / 365, not ACT/ACT ISDA where denominator counts days in/not in leap year) ACT/360 (actuals / 360) 30E/360 (min d1/d2 to 30, using the classic formula)

https://en.wikipedia.org/wiki/Day_count_convention

Future: should review Wikipedia against packages (like QL or Rateslib) and compare to source docs (eg ISDA spec...)

amalizzio commented 2 months ago

@Batu4 can you please pull my branch feat-daycounters

I have provided the code, i need you to validate the calculations

Batu4 commented 2 months ago

Started feat-daycounters-review:

Todo

FYI - coverage/ruff/isort/black all 100% as expected

amalizzio commented 2 months ago

@Batu4

Batu4 commented 2 months ago

feat-daycounters-review

Batu4 commented 2 months ago

BD252 Issues: testcases report in the spreadsheet and I attached the spreadsheet here

Day_Count.xlsx

Batu4 commented 2 months ago

Summary:

Todo:

Batu4 commented 1 month ago

Summary: