Abstract
Cryptocurrencies are significantly reshaping the economic framework because of its developing mainstream advancement and trader acknowledgment. With cryptocurrencies gathering lot of interest, the volatility of cryptocurrency prices and complexity of its underlying technology-blockchain has also brought into the consideration a risk factor in its large-scale adoption. This brings about an immediate need to attempt to comprehend and amend certain process to reduce the risk and increase understandability of cryptocurrency behavior. Through this study, we aim to form a model to forecast cryptocurrency prices in the market as a time series using the concept of deep learning. Specifically, long short-term memory cells are used in the neural network architecture over normal artificial neural networks to overcome the inability of the latter to retain long sequences of data. The feature that we forecast is the open prices of the cryptocurrencies. This model has been implemented on Bitcoin, Ethereum, Litecoin and Bitcoin-cash prices with minimal errors in the predictions and forecasted prices. Moreover, this model is also compatible with automation and is scalable with deployments using APIs and WebApps which has also been tested.
Access provided by Autonomous University of Puebla. Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
The fast improvement of cryptocurrency standards during the most recent decade is one of the most disputable and questionable developments in the cutting-edge worldwide economy [1, 2]. Huge variances in the conversion scale of digital forms of money and their high instability, just as the absence of legitimate guidelines of their exchanges in many nations brought about noteworthy risks related to a venture into crypto resources [3]. This has prompted speculative research about their place and role in the foreseeable future [4]. Hence, the issue of creating fitting strategies and models for the very purpose of foreseeing costs for the cryptocurrency is important both for established researchers and for analysts, financial specialists and brokers.
A comparative analysis of the ARIMA forecasting properties with recurrent neural networks (RNNs) was conducted by Rebane and Karlsson [5] for cryptocurrencies such as Ethereum (ETH), Ripple (XRP), Litecoin (LTC), DASH, NEM (XEM), Siacoin (SC), Monero (XMR) and Stellar (STR). The results showed that ARIMA models have poorer forecasting properties than neural networks.
A study [6] reveals that macroeconomic and financial indicators have a relatively minute correlation with the composition of bitcoin prices. It is observed that variables like transaction volume affected the supply and demand of bitcoin. Thus, in our approach, we define this as a time series forecast problem which can be solved using LSTM and root means square error (RMSE) as an evaluation metric for closing prices where sequences of prices are “remembered” by the model during the process.
2 Related Work
Countless research has been conducted of the change of Bitcoin value using Time Series Analysis [7]. Research on Bitcoin value utilizing twitter sentiment information has been conducted by Lönnö and Stenqvist [8]. VADER–valence aware dictionary and sentiment reasoner which is a “consolidated vocabulary-based way to deal with measuring the person tweet assumption force and afterward assembled the scores into time-arrangement” has been considered here. Their model resulted in a precision of about 79%.
Linear SVM and Neural Network related research has been conducted by Kim [9]. The after effect of his trial deciphers that “the estimation of the upper bound and the kernel parameter has a delicate job in the presentation of Support Vector Machine's expectation.” Their research resulted in an accuracy of 64.75%.
A suitable model that can predict the market price of Bitcoin is proposed in [10] using a few statistical models. A combination of MA and AR models has resulted in the ARIMA model. It uses the result of the autocorrelation charts where it finds out the order and then fits the data integrating MA and AR observations, resulting in better accuracy than the others. With AR and MA, the Bitcoin price is predicted with accuracy of 89.24 and 87.58%, respectively, while the ARIMA model resulted in an accuracy of 90.31%.
To analyze the price dynamics of Ethereum, Bitcoin and Ripple, authors in [11] propose a long short-term memory (LSTM) recurrent neural network and an artificial neural network (ANN). It was found that LSTM tends to rely more on short-term memory, while ANN tends to rely more on long-term memory, which tells us that—“efficiency of LSTM to utilize useful information hidden in historical memory is stronger than ANN. However, given enough historical information ANN can achieve a similar accuracy, compared with LSTM.”
In Lipo Wang and Edwin Sin's paper [12], genetic algorithm, an artificial neural network ensemble approach, explores the relationship between the prices of Bitcoin on consecutive days. We infer that—“the ensemble method, GASEN, was able to perform well for the classification task with consistent accuracy of around 58% to 63%. With a simple trading strategy, the ensemble was able to obtain promising results in making profit of close to 85% in return.”
The paper by Sean McNally, Simon Caton and Jason Roche [13] aims to predict Bitcoin prices in USD using different models. They found that—“LSTM achieved the best accuracy, whereas the RNN achieved all-time low RMSE. The ARIMA prediction performed poorly in terms of accuracy and RMSE. Deep learning models like the RNN and LSTM are manifestly effective for Bitcoin prediction with the LSTM more capable for recognizing longer-term dependencies.”
3 Proposed System
We outline the problem on a one-to-one sequence problem and use a neural network with stacked long short-term memory (LSTM) cell design to predict the costs of cryptocurrencies. LSTMs have a foothold over standard feed-forward neural networks and recurrent neural networks [14, 15]. This is often attributable to their property of selectively remembering patterns for long durations of time [16]. We tend to train a model consisting of a network of LSTM cells stacked over one another and outline a pipeline for the deployment of the model. The “close” values of cryptocurrency values are taken as the sequential input for the model. Alternatively, the volume/open/high/low/market cap will be chosen subjects to the appliance of the model.
The proposed system consists of the subsequent phases:
-
Phase 1: Identify the currencies most talked about and identify their historical data containing following attributes–opening price, highest value, lowest value, closing value, volume and market cap.
-
Phase 2: Data pre-processing and EDA.
-
Phase 3: Create train-test-validation data partitions.
-
Phase 4: Build a predictive model using LSTM architectures.
-
Phase 5: Test the model and tune hyper parameters.
-
Phase 6: User integration and visualization with an interface.
Figure 1 describes the proposed system for predicting cryptocurrency prices using LSTM.
4 Data Pre-Processing
Many machine learning algorithms endeavor to discover trends in the information by looking at the highlights of data points [17, 18]. In any case, there is an issue when the highlights are on radically various scales. To solve this, we use scalar. The main objective of scalar is to make each data point have a similar scale so each component is equally significant.
We will be using the min–max scalar is one of the most well-known approaches to standardize information. For each element, the base estimation of that element gets changed into a 0, the most extreme value gets changed into a 1, and all other weighted points get changed into a decimal somewhere in the range of 0 and 1.
Min–max scalar is sensitive to the presence of outliers. We use this trait in order to not lose information about our data, i.e., the data’s volatility.
5 Model Architecture
The model basically recreates a network to work like the neurons in our brain. The network is trained to give predictions based on being trained on existing data. Deep neural networks have been used in accounting of economic markets. In our study, we use an overarching profound learning model to break down and anticipate cryptocurrency value elements through long short-term memory. The LSTM incorporates three layers, each having ten nodes. Each LSTM cell state contains three gates—forget gate, input gate and an output gate. LSTM controls the removal or addition of data through the gates to accomplish the function of either ignoring or committing memory (Fig. 2).
Figure 3 Mathematical Shown above is the complete architecture of RNN developed during this project. We have used LSTM cells with Adam optimizer and MSE to calculate error. It contains 4 layers. The first layer is the input layer. It acts as the entry point of the cryptocurrency data into the RNN. The second and third layers are LSTM layers. Its input space dimensionality is 1 and 256, respectively, while the output space dimensionality is 256 for both. They use hyperbolic tangent (tanh) as the activation function and sigmoid as the activation function for the recurrent step. The fourth and final layer is a dense layer. It computes the dot product of its input matrix and weight matrix, and then adds to it the bias, producing the prediction value (Fig. 4).
The following graphs show mean squared error vs epoch number plots obtained after training the model for Bitcoin, Ethereum, Litecoin and Ripple time series data, dating back to 2017 (Figs. 5, 6, 7, 8).
6 Results
After training the 4 datasets using the proposed model, the following results were observed. In terms of mean squared error (MSE), the LSTM model shows superior performance when compared with an ANN model in general while predicting cryptocurrency values. The MSE values obtained after training datasets for Bitcoin (BTC), Ethereum (ETH), Litecoin (LTC) and Ripple (XRP) are 1.4925 e−04, 6.0898 e−05, 5.0990 e−05, 2.4237 e−04, respectively.
The comparison of results existing between support vector regression (SVR), neural network (NN), decision tree regression (DTR) [19], and our proposed LSTM model has been tabulated below (Table 1):
The following graphs showcase the predicting capabilities of the proposed model (Figs. 9, 10,11, 12).
7 Conclusion and Future Work
Cryptocurrency price forecasting is an important component of automation in forex and algorithmic trading [20]. A model that predicts prices with minimal error can be integrated with software’s and used in accordance with trading strategies [21]. Moreover, this forecasting model that uses LSTM can also be applied to other features like close prices, market capitalization, etc.
This model can be deployed as a service on the cloud or even as a rest API that is scalable according to usage and market fluctuation. The existence of this model deems useful for multiple economic frameworks by increasing explain ability and reducing risk in cryptocurrency domain.
References
Aggarwal A, Gupta I, Garg N, Goel A (2019) Deep learning approach to determine the impact of socio economic factors on bitcoin price prediction. In: 2019 Twelfth international conference on contemporary computing (IC3), Noida, India
Misnik A, Krutalevich S, Prakapenka S, Borovykh P, Vasiliev M (2019) Impact analysis of additional input parameters on neural network cryptocurrency price prediction. In: 2019 XXI international conference complex systems: control and modeling problems (CSCMP), Samara, Russia, 2019
Wimalagunaratne M, Poravi G (2018) A predictive model for the global cryptocurrency market: a holistic approach to predicting cryptocurrency prices. In: 2018 8th international conference on intelligent systems, modelling and simulation (ISMS), Kuala Lumpur, Malaysia
Bai C, White T, Xiao L, Subrahmanian VS, Zhou Z (2019) C2P2: a collective cryptocurrency up/down price prediction engine. In: 2019 IEEE international conference on blockchain (Blockchain), Atlanta, GA, USA, 2019.
Rebane J, Karlsson I (2018) Seq2Seq RNNs and ARIMA models for cryptocurrency prediction: a comparative study. In: SIGKDD Fintech’18, August 2018, London, UK. https://fintech.kdd2018.a.intuit.com/papersDSF2018_paper_papapetrou.pdf
Ciaian P (2015) The economics of Bitcoin price formation. Appl Econ 48:1799–1815
Karasu S, Altan A, Saraç Z, Hacioğlu R (2018) Prediction of bitcoin prices with machine learning methods using time series data. In: 2018 26th signal processing and communications applications conference (SIU), Izmir
Stenqvist E, Lönnö J Predicting Bitcoin price fluctuation with Twitter sentiment analysis. unpublished
Kim K (2003) Financial time series forecasting using support vector machines. Neurocomputing 55(12):307319
Roy S, Nanjiba S, Chakrabarty A (2018) Bitcoin price forecasting using time series analysis. In: 21st International conference of computer and information technology, IEEE
Yiying W, Yeze Z (2019) Cryptocurrency price analysis with artificial intelligence. In: 5th International conference on information management, IEEE
Sin E, Wang L (2017) Bitcoin price prediction using ensembles of neural networks. In: 13th International conference on natural computation, fuzzy systems and knowledge discovery. IEEE
McNally S, Roche J, Caton S (2018) Predicting the price of bitcoin using machine learning. In: 26th Euromicro International conference on parallel, distributed, and network-based processing, IEEE
Rathan K, Sai SV, Manikanta TS (2019) Crypto-currency price prediction using decision tree and regression techniques. In: 2019 3rd international conference on trends in electronics and informatics (ICOEI). Tirunelveli, India
Almasri E, Arslan E (2018) Predicting cryptocurrencies prices with neural networks. In: 2018 6th International conference on control engineering and information technology (CEIT), Istanbul, Turkey
Jay P, Kalariya V, Parmar P, Tanwar S, Kumar N, Alazab M (2020) Stochastic neural networks for cryptocurrency price prediction. IEEE Access 8:82804–82818
Rane PV, Dhage SN (2019) Systematic erudition of bitcoin price prediction using machine learning techniques. In: 2019 5th international conference on advanced computing and communication systems (ICACCS), Coimbatore, India
Alessandretti L, ElBahrawy A, Maria Aiello L, Baronchelli A (2018) Anticipating cryptocurrency prices using machine learning. Complexity 8983590:16
Pintelas E, Livieris IE, Stavroyiannis S, Kotsilieris T, Pintelas P (2020) Invstigating the problem of cryptocurrency price prediction: a deep learning approach. In: Maglogiannis I, Iliadis L, Pimenidis E (eds) Artificial intelligence applications and innovations. AIAI 2020. IFIP advances in information and communication technology, vol 584. Springer, Cham
Liang J, Li L, Chen W, Zeng D (2019) Towards an understanding of cryptocurrency: a comparative analysis of cryptocurrency, foreign exchange, and stock. In: 2019 IEEE international conference on intelligence and security informatics (ISI), Shenzhen, China
Mohanty P, Patel D, Patel P, Roy S (2018) Predicting fluctuations in cryptocurrencies’ price using users’ comments and real-time prices. In: 2018 7th international conference on reliability, infocom technologies and optimization (Trends and Future Directions) (ICRITO), Noida, India
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Aditya Pai, B., Devareddy, L., Hegde, S., Ramya, B.S. (2022). A Time Series Cryptocurrency Price Prediction Using LSTM. In: Shetty, N.R., Patnaik, L.M., Nagaraj, H.C., Hamsavath, P.N., Nalini, N. (eds) Emerging Research in Computing, Information, Communication and Applications. Lecture Notes in Electrical Engineering, vol 790. Springer, Singapore. https://doi.org/10.1007/978-981-16-1342-5_50
Download citation
DOI: https://doi.org/10.1007/978-981-16-1342-5_50
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-16-1341-8
Online ISBN: 978-981-16-1342-5
eBook Packages: EngineeringEngineering (R0)