AI4Finance-Foundation / FinRL

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

The agents seems to buy only few stocks at the start of the trading and holds them throughout the period? #1107

Closed Mr-Nobody-dey closed 9 months ago

Mr-Nobody-dey commented 9 months ago

### Problem -> Agents did not take optimum actions

I trained the models with exactly same configurations as mentioned in this example "examples/Stock_NeurIPS2018_SB3.ipynb". I trained the models for 100000 time steps. Once the models were trained, I checked the agents action on the trading datasets, I found that the agents did not do any trading, It simply bought few stocks at the beginning of the trading (1st day on which the model is tested on unseen data) and hold those stocks throughout the period. It did not sell even when their were huge drop in price (Loss).

What might be the reasons?

  1. Those models need to train longer. -> If so, then how will i know when to stop?
  2. Choose better technical indicator.
  3. Any other suggestions?
mmmarchetti commented 9 months ago

The issue you're describing, where the agents do not take optimum actions during trading on unseen data and simply buy and hold, could indeed be indicative of overfitting. Here are some potential reasons and suggestions for addressing this problem:

Technical Indicators: The choice of technical indicators plays a crucial role in the performance of your RL agent. If the indicators you are using are not suitable for capturing the relevant market signals, the agent may struggle to make optimal decisions. Consider experimenting with different indicators and feature representations to better capture the dynamics of the financial markets.

Features Number: The number of features does not necessarily represent better results. Try adjusting the number of features and testing the results.

If the results do not improve after these last two attempts, it is recommended to train for a longer period of time.

Mr-Nobody-dey commented 9 months ago

Thank you for your comment. Will look into it.