Reinforcement algorithm for Trading
If you would have posted this in quantF SE site the most people there would have argued that it is not possible with machine learning techniques to do trading. - One can verify this because of the thread you linked in your comment. - The underlaing argument they are making have something to do with Efficient Market Hypothesis (Fama 1970) and the CAPM. You can read more about that in the original article or on wikipedia.
The point is that the EMH is a scientific hypothesis, that holds under certain circumstances. Nothing more and less. The research in the past decades proved the hypothesis in several markets and configuration. But the problem - which has been fixed by Fama later - is the size premium and the value premium. Because of this, a lot of people (e.g. Buffett and Graham) relayed on value investing (or fundamental) strategies.
The EMH additionally builds the ground for the ETF hype. - I'm not saying that this isn't working. It is just the only reliable product we have to invest in stock markets with sustainable return. - If you think about how ETFs work, you will quickly understand that one ETF build a large selection of stocks. In statistical terms: You widen your sample to get less bias, but you also get lower variance.
What AI practitioners try to do, and deeply believe is: It could be that a human is not able to beat the market by picking stocks, but a computer, which is a excellent machine for pattern recognition - would be able to do it; be able to pick a sample what represents the winners in every market situation.
For deeper diving in to this topic you can read the Article by Hsu et al. (2016). They did research about if and how this could be possible.
The beautifully that Deep Reinforcement Learning brings us is, that it learns itself to recognize the patterns hidden in the data, extract the features and learn how to take the actions. It is forecasting and action taking in one step. For a deeper understanding of these algorithms and underlaying theory I would recommend you to read the book by Sutton and Barto (2018). It is like the bible in (Deep) RL.
Additionally you should watch the Deep RL course by David Silver and the updated one by other researchers of DeepMind.
A good starting point to understand DRL for trading with code is the ICAIF 2020 paper and Github Repo by Yang et al. (2020), which I relay on for my masters thesis.
References
Fama, E. (1970). Efficient Capital Markets: A Review of Theory and Empirical Work. The Journal of Finance, 25(2), 383-417. doi:10.2307/2325486
Hsu, Ming-Wei; Lessmann, Stefan; Sung, Ming-Chien; Ma, Tiejun; Johnson, Johnnie E. V. (2016): Bridging the divide in financial market forecasting: machine learners vs. financial economists. In: Expert Systems with Applications 61, pp. 215-234.
Sutton, Richard S.; Barto, Andrew (2018): Reinforcement learning. An introduction. Second edition. Cambridge, MA, London: The MIT Press (Adaptive computation and machine learning).
Yang, Hongyang and Liu, Xiao-Yang and Zhong, Shan and Walid, Anwar, Deep Reinforcement Learning for Automated Stock Trading: An Ensemble Strategy (September 11, 2020). Available at SSRN: https://ssrn.com/abstract=3690996 or http://dx.doi.org/10.2139/ssrn.3690996