We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
import numpy as np import pandas as pd import vectorbt as vbt close = pd.Series([1, 2, 3, 4, 5]) val_price = close size = [1, np.nan, np.nan, np.nan, -1] portfolio = vbt.Portfolio.from_orders(close, size, val_price=val_price, close_first=True, freq='1D') # print(portfolio.stats()) # print(portfolio.returns_stats())
D:\Users\Kan\miniconda3\envs\py38_vectorbt\lib\site-packages\vectorbt\utils\datetime.py:23: RuntimeWarning: invalid value encountered in multiply return obj * freq_delta(freq) Traceback (most recent call last): File "D:/test_vectorbt/demo_from_orders_3.py", line 16, in <module> print(portfolio.returns_stats()) File "D:\Users\Kan\miniconda3\envs\py38_vectorbt\lib\site-packages\vectorbt\portfolio\base.py", line 1980, in returns_stats stats_obj = returns.vbt.returns.stats(**kwargs) File "D:\Users\Kan\miniconda3\envs\py38_vectorbt\lib\site-packages\vectorbt\returns\accessors.py", line 343, in stats 'Duration': self.wrapper.shape[0] * self.wrapper.freq, TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'
the portfolio.stats() can get Duration 5 days 00:00:00, but the portfolio.returns_stats() can not
portfolio.stats()
Duration 5 days 00:00:00
portfolio.returns_stats()
The text was updated successfully, but these errors were encountered:
cc8daa3
No branches or pull requests
Hi,
the
portfolio.stats()
can getDuration 5 days 00:00:00
,but the
portfolio.returns_stats()
can notThe text was updated successfully, but these errors were encountered: