Let’s see how reinforcement learning can get around many of the problems we encounter while trying to create a trading algorithm using a supervised learning approach. The main benefit of using reinforcement learning for trading is that we don’t need to use mathematical models or hand-code trading strategy, because the deep reinforcement agent learns this on its own. All you have to do is to train your deep reinforcement learning algorithm to optimize the metric of your choice. For example, you might want to optimize for net profit or for risk-adjusted return. Net profit is simply how much money your investment made, or lost, over some period of time, taking into account trading fees and any other costs. Risk-adjusted return is a measure of how much money your investment made relative to the amount of risk of having made that investment. This mean that if you’re already optimizing for risk-adjusted return, the policies learned by the deep reinforcement learning algorithm will already take risks into account. In addition, since deep reinforcement learning algorithms are trained on simulated environments, we can create environments that capture all the complexity of the financial markets. For example, we can simulate all the things we mentioned earlier and much more, such as transaction fees, network latencies, the number of stocks available for sale, different agents making transactions, different market conditions, et cetera. Therefore, deep reinforcement learning algorithms can be trained to be robust to all these factors. Moreover, because deep reinforcement learning agents produce actions, then in principle we could teach the algorithms to produce actions that indicate when to buy or, and sell by rewarding the agent appropriately depending on the action taken. In fact, deep reinforcement learning agents could go even further than that, not just learning when to buy, sell or hold, but also learning the number of stocks to sell or buy at each transaction. These are just a couple of reasons why deep reinforcement learning could play a major role in the financial markets, and may even outperform other trading algorithms such as HFT. Now that you have some intuition as to why reinforcement learning is a good alternative to current trading algorithms, let’s dive into the problem we want to solve.