qstrader icon indicating copy to clipboard operation
qstrader copied to clipboard

strategy_backtest.run() error, your assistance please

Open dflow opened this issue 3 years ago • 0 comments

python 3.8.2 64-bit

i get the following error after following the tutorial:

File "/Users/dflow/code/qstrader/sixty_forty.py", line 45, in strategy_backtest.run() File "/Library/Python/3.8/site-packages/qstrader/trading/backtest.py", line 354, in run self.qts(dt, stats=stats) File "/Library/Python/3.8/site-packages/qstrader/system/qts.py", line 119, in call rebalance_orders = self.portfolio_construction_model(dt, stats=stats) File "/Library/Python/3.8/site-packages/qstrader/portcon/pcm.py", line 284, in call target_portfolio = self._generate_target_portfolio(dt, full_weights) File "/Library/Python/3.8/site-packages/qstrader/portcon/pcm.py", line 139, in _generate_target_portfolio return self.order_sizer(dt, weights) File "/Library/Python/3.8/site-packages/qstrader/portcon/order_sizer/dollar_weighted.py", line 162, in call asset_quantity = int( ValueError: cannot convert float NaN to integer

dflow avatar Aug 22 '21 19:08 dflow