AI4Finance-Foundation / FinRL-Meta

FinRL­-Meta: Dynamic datasets and market environments for FinRL.
https://ai4finance.org
MIT License
1.18k stars 555 forks source link

FinRL_PaperTrading_Demo.ipynb cannot convert float NaN to integer #243

Closed marcipops closed 1 year ago

marcipops commented 1 year ago

File: https://github.com/AI4Finance-Foundation/FinRL-Meta/blob/master/tutorials/3-Practical/FinRL_PaperTrading_Demo.ipynb

RuntimeWarning: invalid value encountered in double_scalars buy_num_shares = min(tmp_cash // self.price[index], abs(int(action[index]))) Exception in thread Thread-12027: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "FinrRL_PaperTrading_Demo.ipynb", line 218, in trade qty = abs(int(buy_num_shares)) ValueError: cannot convert float NaN to integer