softandiron/tinkproject

29

iLnurZ opened this issue · 3 comments

29

29.09.2021 все работало.

09:20:45 [INFO] root: calculating XIRR..
Traceback (most recent call last):
File "E:\Google Disk\Atrd\tinkproject-main (1)\tinkproject-main\main.py", line 456, in xirr
result = scipy.optimize.newton(lambda r: xnpv(valuesPerDate, r), 0)
File "C:\Python39\lib\site-packages\scipy\optimize\zeros.py", line 361, in newton
raise RuntimeError(msg)
RuntimeError: Failed to converge after 50 iterations, value is 3.56016474287079e+43.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:\Google Disk\Atrd\tinkproject-main (1)\tinkproject-main\main.py", line 548, in
xirr_value = calculate_xirr(my_operations, (portfolio_cost_rub_market - sum_profile['exp_tax']))
File "E:\Google Disk\Atrd\tinkproject-main (1)\tinkproject-main\main.py", line 490, in calculate_xirr
x = round((xirr(dates_values_composed) * 100), 2)
File "E:\Google Disk\Atrd\tinkproject-main (1)\tinkproject-main\main.py", line 458, in xirr
result = scipy.optimize.brentq(lambda r: xnpv(valuesPerDate, r), -0.999999999999999, 1e20, maxiter=10**6)
File "C:\Python39\lib\site-packages\scipy\optimize\zeros.py", line 776, in brentq
r = _zeros._brentq(f, a, b, xtol, rtol, maxiter, args, full_output, disp)
ValueError: f(a) and f(b) must have different signs

Добрый день!

Такое изредка бывает при закрытых рынках. Попробуйте еще раз прогнать, после открытия рынков.

Хотя согласен - надо сделать обработчик. Чуть позже сделаю.

Спасибо. Попробую.