ClementPerroud / Gym-Trading-Env

A simple, easy, customizable Gymnasium environment for trading.
https://gym-trading-env.readthedocs.io/
MIT License
270 stars 56 forks source link

the first example just can not run #9

Open milliyang opened 11 months ago

milliyang commented 11 months ago

(py39) C:\Users\leo\Gym-Trading-Env-main>python examples\example_environnement.py Traceback (most recent call last): File "C:\Users\leo\Gym-Trading-Env-main\examples\example_environnement.py", line 44, in env.add_metric('Position Changes', lambda history : np.sum(np.diff(history['position']) != 0) ) File "C:\Users\leo\anaconda3\envs\py39\lib\site-packages\gymnasium\core.py", line 297, in getattr logger.warn( File "C:\Users\leo\anaconda3\envs\py39\lib\site-packages\gymnasium\logger.py", line 55, in warn warnings.warn( UserWarning: WARN: env.add_metric to get variables from other wrappers is deprecated and will be removed in v1.0, to get this variable you can do env.unwrapped.add_metric for environment variables or env.get_attr('add_metric') that will search the reminding wrappers.

need to fix: env.unwrapped.add_metric()