Building a predictive model for cryptocurrencies investment

Building-a-predictive-model-for-cryptocurrencies-investment

One of the challenges when teaching Machine Learning is to project the impression that everything can be predicted under any circumstance. However, there are very powerful algorithms that facilitate finding patterns within apparently random data series.

There are many areas with high potential for predictive modelling, being cryptocurrencies one of them. Training an algorithm to predict values for Bitcoin (BTC), Etherium (ETH) or Litecoin (LTC) for example, would be a modern “Philosopher’s Stone”. Let’s see the potential and limitations of the machine learning techniques and what would be the best approach and investment opportunities.

In the early times of the cryptocurrencies, it was relatively easy to “mine” new coins using home computers, but this is not possible today and the cost of hardware and electricity would be higher than the potential benefic (if there is any). Many specialized websites are recommending the investment as the most profitable way to make money.

Many investment platforms are offering different strategies to obtain quick benefits based on data analysis based on Machine Learning techniques.

To explain how these models works I have created a functional prototype to obtain actual values from a broker platform, train an algorithm using this data and forecasting futures values.

Machine Learning is about pattern recognition and it’s being successfully applied in different and various fields from real state investing to sports betting.

In more traditional markets it’s easy to find correlations between two variables to give us a vector for our prediction. For example, the price of the commodities is going to give us a good indicator for heavy machinery stocks performance.

Knowing the history of different football teams will be possible to estimate the probability to forecast the result.

What happen when if we try to predict the cryptocurrencies value? These are the difficulties from the machine learning point of view:

  • Cryptocurrency markets are open 24/7/365 but no seasonality has been identify, therefore algorithms like ARIMA will not helpful.
  • There is not a clear correlation between the tokens values and traditional markets.
  • There is a strong correlation among the most common cryptocurrencies and the variability very similar, so we cannot use one of them as a vector for another. In this case, a robust algorithm like random forest would not be useful.

Fortunately, we count with algorithms to identify a pattern within a time series and generate future datapoints without a reference vector value. Prophet has been developed by Facebook and it enables to encapsulate a specific period, identify a pattern and finally generate future data points.

In addition to that, and knowing the challenges we may be facing trying to build a predictive model, Prophet will offer 3 different predictions:

  • Ascending, based on the highest values of the series.
  • Descending, based on the lowest values.
  • Baseline.

Using this algorithm, a predictive model has been developed to generate every two hours a prediction based in the last 24 hours. In this way, we can have a forecast with 3 different strategies for the next 2 hours (120 minutes) based on the last 24 hours.

Finally, to evaluate the predictive model scoring the predicted and the actual values are superimposed:

BTC prediction

In this case, the Orange line (prediction based on the lowest values) is very close to the Red line (actual value of the Bitcoin in the last 2 hours).

Another comparison to be done is the actual values with the previous period (naïf analysis). In a period of stability there is no need of predictions because the base line is giving as the best clue (until the volatility acts!).

Potentially, we could use this prototype to analyze and define an short term investing strategy in these steps:

  • Identify the trend in the last 24 hours adding a delta of 120 minutes in every run.
  • Evaluate the stability or volatility within a time range.
  • Choose a prediction positive or negative based on the trend.

The increasing importance of the cryptocurrencies in the financial markets and the continuous development of more sensitive machine learning algorithms will offer great opportunities for analysts to create predictive models combining business knowledge and technical expertise.

Nowadays the design, development and automation of predictive models is very quick and the access to real time information is possible, unleashing a great potential for investing or just to get a deep analytical understanding of the new economy.

By Francisco Cantero

Shadow