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

xirr function returns None #65

Open
cmodi369 opened this issue Jan 12, 2025 · 0 comments
Open

xirr function returns None #65

cmodi369 opened this issue Jan 12, 2025 · 0 comments

Comments

@cmodi369
Copy link

Details

import datetime
from pyxirr import xirr

dates = [
    datetime.date(2020, 5, 27),
    datetime.date(2020, 5, 27),
    datetime.date(2020, 5, 27),
    datetime.date(2020, 5, 28),
    datetime.date(2020, 5, 28),
    datetime.date(2020, 5, 28),
    datetime.date(2020, 5, 28),
    datetime.date(2020, 5, 28),
    datetime.date(2020, 5, 28),
    datetime.date(2020, 5, 28)
]

values = [187.5, -30, 187.5, 187.5, 187.5, -188, -188, -188, -188, -188]

# This returns `None`
xirr(dates, values)

# Update value from -30 to -25 
values[1] = -25

# This returns `8.181769983749503e+75`
xirr(dates, values)

It would be good if instead of None exception can be raised. I am not able to understand why xirr function is returning None in the first case. Let me know how I can fix this.

Let me know your thoughts.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant