Introduction

According to the efficient-market hypothesis [1], stock prices follow a random walk, and it is impossible to forecast direction and magnitude changes. However, with the development of machine learning tools, various works have been employed in modeling and prediction stock prices [2] to generate better forecasts. Indeed, this task is a critical step in financial decision-making related to portfolio optimization, risk evaluation, and trading. One of the hot topics in financial time series is to analyze and predict prices of cryptocurrencies by using machine learning. To cite the most recent works that focus on application in the relevant field, long-short–term memory and generalized neural networks were employed in [3]; neuro-fuzzy controller in [4],;combination of complete empirical ensemble mode decomposition, and support vector machine in [5]; artificial neural networks, support vector machines, and ensemble algorithms in [6]; decision trees in [7]; and support vector regressions, Gaussian Poisson regressions, regression trees, k-nearest neighbors algorithm, standard feed-forward neural networks, Bayesian regularization neural networks, and radial basis function neural networks [8].

Our goal is to implement and validate a deep feed-forward neural network in the task of forecasting Bitcoin price at high-frequency sampling. Indeed, this is the first time DFFNN is designed to analyze hidden patterns in Bitcoin high-frequency price data for forecasting purpose. Additionally, we examine the effect of three standard training algorithms used to update DFFNN weights on its forecasting performance as the choice of the training algorithm is determinant.

Deep Feed-forward Neural Network Training

The deep feed-forward neural network (DFFNN) [9] has several hidden layers. Specifically, the information in DFFNN moves from the input layer through the hidden layers to the output layer, and there is no feedback or loop in the network [9] which basically makes it deep and fast. A deep neural network architecture can learn very complex functions thanks to computations performed by multiple hidden layers to adjust its weights. The training of the DFFNN is performed by updating the change in its weights at each iteration according to three different numerical algorithms: conjugate gradient with Powell-Beale restarts, resilient algorithm, and Levenberg-Marquardt algorithm. The performance of the DFFNN under each training algorithm is evaluated by using the root mean of squared errors (RMSEs). The architecture of the DFFNN is organized as follows. The input layer has five neurons corresponding to the last observed prices of Bitcoin. There are three hidden layers, each with 20 neurons. Finally, the output layer has one single neuron corresponding to the forecasted Bitcoin price. Besides, the number of epochs is set to 50, and the learning rate α is set to 0.001.

Data and Results

The high frequency sampling of the Bitcoin intraday price data is at 5 min for the period from 1 January 2016 to 16 March 2018. Thus, the collected data has totally 65,535 observations. For simulation purposes, the first 80% samples of the full set are used for training each DFFNN and the remaining 20% are used for testing. Figure 1 shows the true and forecasted price series generated by each DFFNN on the testing sample. As shown, the DFFNN was able to generate forecasts close to the observed values under all three training algorithms. The comparison results show that the problem of Bitcoin high-frequency price time series prediction, the Levenberg-Marquardt algorithm performs the best (RMSE = 1.4406), followed by Powell-Beale restarts (RMSE = 2.3187), and the resilient algorithm (RMSE = 2.9715).

Fig. 1
figure 1

Forecasted versus true Bitcoin price series by each DFFNN training algorithm

Conclusions

We evaluated a deep feed-forward neural network in high-frequency Bitcoin price time series forecasting under three different training algorithms including the conjugate gradient with Powell-Beale restarts, the resilient algorithm, and Levenberg-Marquardt algorithm. The experimental results demonstrated the superiority of the Levenberg-Marquardt algorithm in terms of forecasting accuracy whilst the resilient algorithm performs the worst.