Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: when period=3M start date falls on a Sunday, IRR % is wrong #49

Open
wilsonleong opened this issue Feb 7, 2022 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@wilsonleong
Copy link
Owner

wilsonleong commented Feb 7, 2022

Considerations:

  • what if it falls on to a HK holiday or US holiday where there is no market data (for latest valuation calculation) for either HK or US market?
@wilsonleong wilsonleong self-assigned this Feb 7, 2022
@wilsonleong wilsonleong added the bug Something isn't working label Feb 7, 2022
@wilsonleong
Copy link
Owner Author

Incorrect starting cashflow value in IRR calculation on market holidays

For IRR calculation, when date range start date has no market data (weekend or market holiday), the "previous valuation" as of start date becomes 0 incorrectly, causing error in the IRR calculation.

Tactical fix by adjusting start date as Friday when it falls onto a Saturday or Sunday.

This still does not adjust for market holidays in HK or US. Proper fix should check for market holidays and try to get valuations for the previous business day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant