You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the current behavior
Testing new chart render. Errror:
"C:\Users\Miner\Documents\GitHub!MyTensorTrader\tensortrade\environments\render\matplotlib_trading_chart.py", line 132, in render
net_worth = round(net_worths[-1], 2)
IndexError: index -1 is out of bounds for axis 0 with size 0
Describe the expected behavior
Code to reproduce the issue
episodes = 1
performance = strategy.run(episodes=episodes, render_mode="chart")
Other info / logs
Traceback (most recent call last):
File "C:/Users/Miner/Documents/GitHub/!MyTensorTrader/main.py", line 83, in
performance = strategy.run(episodes=episodes, render_mode="chart")
File "C:\Users\Miner\Documents\GitHub!MyTensorTrader\tensortrade\strategies\stable_baselines_strategy.py", line 116, in run
self._environment.render(mode=render_mode)
File "C:\ProgramData\Anaconda3\envs\PYTrade\lib\site-packages\stable_baselines\common\vec_env\dummy_vec_env.py", line 64, in render
return self.envs[0].render(*args, **kwargs)
File "C:\Users\Miner\Documents\GitHub!MyTensorTrader\tensortrade\environments\trading_environment.py", line 248, in render
self.exchange.trades)
File "C:\Users\Miner\Documents\GitHub!MyTensorTrader\tensortrade\environments\render\matplotlib_trading_chart.py", line 132, in render
net_worth = round(net_worths[-1], 2)
IndexError: index -1 is out of bounds for axis 0 with size 0
The text was updated successfully, but these errors were encountered:
There was a bug: environment will be reset before render.
stable-baselines will reset env in the _environment.step when environments is done.
The solution: in render funtion modify code if self.viewer is not None and self._current_step > 1:
System information
Describe the current behavior
Testing new chart render. Errror:
"C:\Users\Miner\Documents\GitHub!MyTensorTrader\tensortrade\environments\render\matplotlib_trading_chart.py", line 132, in render
net_worth = round(net_worths[-1], 2)
IndexError: index -1 is out of bounds for axis 0 with size 0
Describe the expected behavior
Code to reproduce the issue
episodes = 1
performance = strategy.run(episodes=episodes, render_mode="chart")
Other info / logs
Traceback (most recent call last):
File "C:/Users/Miner/Documents/GitHub/!MyTensorTrader/main.py", line 83, in
performance = strategy.run(episodes=episodes, render_mode="chart")
File "C:\Users\Miner\Documents\GitHub!MyTensorTrader\tensortrade\strategies\stable_baselines_strategy.py", line 116, in run
self._environment.render(mode=render_mode)
File "C:\ProgramData\Anaconda3\envs\PYTrade\lib\site-packages\stable_baselines\common\vec_env\dummy_vec_env.py", line 64, in render
return self.envs[0].render(*args, **kwargs)
File "C:\Users\Miner\Documents\GitHub!MyTensorTrader\tensortrade\environments\trading_environment.py", line 248, in render
self.exchange.trades)
File "C:\Users\Miner\Documents\GitHub!MyTensorTrader\tensortrade\environments\render\matplotlib_trading_chart.py", line 132, in render
net_worth = round(net_worths[-1], 2)
IndexError: index -1 is out of bounds for axis 0 with size 0
The text was updated successfully, but these errors were encountered: