Describe the bug
When running the Stock_NeurIPS2018_SB3.ipynb In[21] and In[22], the StockTradingEnv can not be created.
It reported below error:
"Traceback (most recent call last):
File "d:/Trading/ppoALpaca/train.py", line 137, in
e_train_gym = StockTradingEnv(df = processed_full, **env_kwargs)
File "D:\Program\anaconda3\envs\trade\lib\site-packages\finrl\meta\env_stock_trading\env_stocktrading.py", line 76, in init
self.state = self._initiate_state()
File "D:\Program\anaconda3\envs\trade\lib\site-packages\finrl\meta\env_stock_trading\env_stocktrading.py", line 404, in _initiate_state
self.data.close.values.tolist()
AttributeError: 'numpy.float64' object has no attribute 'values'
To Reproduce
Nothing in the original notebook was modified. Just run it step by step.
Suspect reason
Perhaps the below line in env_stocktrading.py causes the error:
self.data = self.df.loc[self.day, :]
In the case of multiple tickers, this line just extracts the first row of data to initiate the initial state, which causes the state space wrong.
Describe the bug When running the Stock_NeurIPS2018_SB3.ipynb In[21] and In[22], the StockTradingEnv can not be created. It reported below error: "Traceback (most recent call last): File "d:/Trading/ppoALpaca/train.py", line 137, in
e_train_gym = StockTradingEnv(df = processed_full, **env_kwargs)
File "D:\Program\anaconda3\envs\trade\lib\site-packages\finrl\meta\env_stock_trading\env_stocktrading.py", line 76, in init
self.state = self._initiate_state()
File "D:\Program\anaconda3\envs\trade\lib\site-packages\finrl\meta\env_stock_trading\env_stocktrading.py", line 404, in _initiate_state
To Reproduce Nothing in the original notebook was modified. Just run it step by step.
Suspect reason Perhaps the below line in env_stocktrading.py causes the error: self.data = self.df.loc[self.day, :] In the case of multiple tickers, this line just extracts the first row of data to initiate the initial state, which causes the state space wrong.