mhallsmoore / qstrader

QuantStart.com - QSTrader backtesting simulation engine.

Home Page:https://www.quantstart.com/qstrader/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

strategy_backtest.run() error, your assistance please

dflow opened this issue · comments

commented

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

Version 0.2.4 now longer supports Python 3.8.
Please see the change log for more details.

Thanks