mhallsmoore / qstrader

QuantStart.com - QSTrader backtesting simulation engine.
https://www.quantstart.com/qstrader/
MIT License
2.79k stars 842 forks source link

strategy_backtest.run() error, your assistance please #370

Closed dflow closed 5 months ago

dflow commented 2 years ago

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

juliettejames commented 5 months ago

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

Thanks