AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
9.37k stars 2.28k forks source link

issue with stable-baselines3 and eleganrl enviroment #1155

Open krishdotn1 opened 5 months ago

krishdotn1 commented 5 months ago

Describe the bug Now finrl use gymnasium which returns 5 parameters in step function like below image image

and 2 parameters from reset method image

taking refrence of this enviroment finrl/meta/env_stock_trading/env_stocktrading.py

but to use elegantrl for same enviroment it shows an error below image

I fixed this error by removing return self.state, self.reward, self.terminal, False, {} changed to return self.state, self.reward, self.terminal, {} from step function and

return self.state, {} changed to return self.state from reset function from this finrl/meta/env_stock_trading/env_stocktrading.py enviromnet

but if I do this elegantrl works fine but instead of gymanisum I have to use gym to train stablebaselines3 and eleganrl model

I think it is an issue with eleganrl which is not compile with gymnasium and finrl enviroment code is written on stable-baselines3 only.

need some good suggestion !