AminHP / gym-anytrading

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

[QUESTION] StocksEnv not giving any reward when trading with crypto or index data #72

Closed Olwar closed 1 year ago

Olwar commented 2 years ago

Hi,

I was battling with this a long time because I couldn't figure our why the env didn't give any reward even after 1 000 000 runs. But apparently StocksEnv doesn't give any reward if you're using data from cryptos or indices (at least S&P 500). Would you say that ForexEnv is the best choice for indices and crypto?

Br, Olwar

Olwar commented 2 years ago

Also another question now that I got the env to give reward. It seems to give exactly the same reward after the first episode as you can see in my notebook: https://github.com/Olwar/eth-reinforcement/blob/master/eth_reinforcement.ipynb

Is this normal behaviour?

Sorry if these questions are dumb, I'm very new to reinforcement learning.

E: I tested with 100 000 timesteps again and it gives the same reward in every episode.

AminHP commented 1 year ago
  1. Yes, because Crypto is designed similar to Forex pairs. For example in Bitcoin, you can trade with BTC/USD or BTC/ETH pairs.
  2. I'm not sure if it is normal, but the loss value is decreasing. Does it happen with the default dataframes?