Open wilsonleong opened 2 years ago
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.
Considerations: