AminHP / gym-anytrading

The most simple, flexible, and comprehensive OpenAI Gym trading environment (Approved by OpenAI Gym)
MIT License
2.1k stars 465 forks source link

Issue with quantstats #26

Closed porcoboia closed 3 years ago

porcoboia commented 3 years ago

Hi @AminHP trying your code into example "a2c_quantstats.ipynb" the last part does not run and I got the following error: File "", line 3, in net_worth = pd.Series(env.history['total_profit'], index=df.index[start_index+1:end_index])

AttributeError: 'ForexEnv' object has no attribute 'history'

I can not figure out how to fix it, do you have any suggestion? Thank you

AminHP commented 3 years ago

Hi

Please update to the latest version.

porcoboia commented 3 years ago

Hi @AminHP , I am using your latest version v1.2.0 released on August 1st, I have the latest version of quantstats (0.0.25) but the issue is still open. I am using python version 3.7.4 with pandas 1.0.1. Any other suggestions? Thank you

AminHP commented 3 years ago

Maybe you have multiple environments, and the "a2c_quantstats.ipynb" example is not running in the proper one.

I suggest you create a new virtual environment and run the notebook in this env explicitly.

porcoboia commented 3 years ago

Hi @AminHP , may be some error happened when I load your SW. I re-load the whole package and now everything is working fine. Thank you for support