Improving crypto investing with Reinforcement Learning

Pablo Leo


No Comments

Cryptocurrencies are a hot topic in the investing world, but is it possible to create an investment methodology combining modern Reinforcement Learning with classical indicators?

Along this blog we have covered topics such as how to automate cryptocurrencies investment or whether reinforcement learning is suitable for trading.

In this post, we try to combine Reinforcement Learning with a cryptocurrencies investment methodology (more information about the methodology here).

Reinforcement Learning

Reinforcement Learning (RL) is a subfield of Machine Learning that aims to train an agent to determine under which conditions is better to perform a given action.

The agent learns by interacting with the environment and receiving rewards depending on the result of each action taken.

Therefore, any investment methodology is suitable for RL, because it’s easy to create an environment in which the agent uses the last ‘n’ returns to make a decision and updates the methodology parameters.

Training process

The RL algorithm used is called Deep Q-Learning, wich has a Neural Network to determine which action should be taken at each step.

In our case, the agent will be in charge of determining whether the methodology uses the crosses of the 6/24 or 6/48 RSI indicators by looking at the last 30 daily returns.

To train the agent, the simulation period is divided in 4 segments, one for each year since 2018 until June 2021.

Cryptocurrencies cumulative returns and simulation segments since 2018 until 2021
Cryptocurrencies cumulative returns and simulation segments since 2018 until 2021

After training on each segment, the model is saved to disk. Later it’s loaded to validate the performance over the next year (next segment).

That is, we train the model on the first segment (2018-2019) and use it in the next (2019-2020); then we train the model again on the first two segments and use it on the third one, and so on.


When the algorithm starts to learn, the portfolio performance grows exponentially, leading to unbelievable results around simulation #100. After further simulations, the performance settles around 3000%.

Cumulative returns of each simulation during the training process
Cumulative returns of each simulation during the training process

NOTE: It has been carefully checked that no information is forwarded in time.


As we show, Reinforcement Learning is a novel algorithm which can lead to incredible results. These results make us wonder the following:

  • Is Reinforcement Learning suitable for other investing methodologies?
  • Will the equity improve by adding more RSI indicators?

What about the future?

If we feed yesterday’s prices, the model says that tomorrow’s (24-06-2021) optimal exposure is:

  • BTC: 0%
  • ETH: 0%
  • ADA: 0%
  • USD: 100%

If you believe in the model, be cautious in your cryptocurrencies investments.

Thanks for reading!

Inline Feedbacks
View all comments