Professional Documents
Culture Documents
net/publication/348987864
CITATIONS READS
6 907
2 authors, including:
Mohammad Ali
United International University
16 PUBLICATIONS 21 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
A Gray Box Interpretable Visual Debugging Approach for Deep Sequence Learning Model View project
A new effective algorithm for protein chain lattice fit problem View project
All content following this page was uploaded by Mohammad Ali on 10 February 2021.
Abstract—Bitcoin is the most popular and valuable Short-Term Memory (LSTM) [1][2][4][8][9][19],
cryptocurrency in the financial market which attracts traders Convolutional Neural Network (CNN) [2], Gated Recurrent
for investment and opens new research opportunities for Unit (GRU) [2], Artificial Neural Network (ANN) [3][16],
researchers. Many research works have been done on bitcoin Hidden Markov Model [4], Multi-linear Regression Model
price prediction with different machine learning prediction [5], Bayesian Neural Network (BNNs) [6], Root Mean
algorithms. Researchers take relevant features from the Squared Error (RMSE) [7], Linear Regression[8],
dataset which have strong correlation with bitcoin prices and Polynomial Regression [8], Recurrent Neural Network
select random data chunks to train and test their model. (RNN) [8][10], Autoregressive Integrated Moving Average
Randomly selected data to train the model, may cause
(ARIMA) [13] [18] etc.
inappropriate results and reduce the accuracy of price
prediction. In this paper, we investigate a proper data selection Bitcoin price prediction models are dependent on various
method to train a prediction model. We apply our proposed blockchain statistics [1], economic factors, and external-
methodology to train a simple linear regression prediction sentimental factors [2]. Researchers select important
algorithm. We predict bitcoin price for 7 days with the linear blockchain statistics such as block size[6][9], number of
regression model. When we train the linear regression model transactions [6][9], median confirmation time[6], hash
with an appropriate data chunk identified by our rate[6][9], transections per block [9], mining difficulty [7],
methodologies, we find acceptable results for the prediction.
cost of transaction [6][9], miner revenue, confirmed
The percentage error method is applied for error calculation
transactions, the total number of unique Bitcoin, Average
which finds the accuracy is 96.97%. In the end of this
manuscript, we conclude our work with future improvements.
Confirmation Time, Number of unique addresses, total
Bitcoin, difficulty to find a block, market capitalization, and
Keywords— Bitcoin, Training Data Selection, Price number of Orphaned Blocks [9]. Some bitcoin economic
Prediction, Linear Regression factors such as closing price, trading volume, volatility [1],
opening and closing price [2][7][9], highest and lowest price
[2][7] have impact on those models as well. Researchers also
I. INTRODUCTION
try to find correlation between human sentiments analyzed
Blockchain is the new era of technology and form Google trend [1][6][8][11], Reddit [1], Twitter
cryptocurrency is one example of blockchain technology in [1][2][5][8][9][10][16], and Wikipedia [6][11].
the financial sector. There are various cryptocurrencies
currently using as payment methods such as Bitcoin, Ripple, Researchers usually first select the dataset, then pick
Litecoin, etc. of which Bitcoin is the most popular and most relevant features from the dataset which are appropriate for
traded [1][5][7]. Bitcoin is a pair-to-pair, decentralized their model. After developing the model, researchers use a
cryptocurrency which has no central bank or authority to chunk of data to train their model and another chunk of data
control [8][9]. Users of the bitcoin network use a test their model with different error finding algorithms [9]
cryptographic hash function which makes the bitcoin [12] [14] [19]. But there is no clear explanation of which
network immutable, secured and trusted [6]. Unlike the portion of data has to be selected to train the model, which
traditional stock market, Bitcoin price can depend on portion of training data gives the best training model with
previous historical data as well as sentiments of users of the high prediction accuracy. In this paper, we answer the
bitcoin network [1]. Therefore, a proper analysis is suggested question. We find that bitcoin price fluctuates more because
for traders before buying, selling, and investing in bitcoin as it depends on various blockchain statistical, economical, and
the analysis used in the stock market might not be helpful for external factors. So, we propose a conceptual model with the
analyzing bitcoin [2]. help of traditional trading algorithms to figure out which data
portion might give accurate results while training the model.
In recent years, various researches have been conducted After the data selection, we made a simple prediction model
on the bitcoin price prediction. Many researchers use with linear regression, trained the model with selected data
different machine learning approaches for cryptocurrency chunks and predicted the following 7 days' bitcoin price.
price forecasting which is emerging as a prominent research
area day by day. Investors take help from these prediction The remaining paper is organized in different sections.
models to know the effective time to invest money on Section 2 describes the most recent literature review on
bitcoins, precisely, time to buy or sell the bitcoins [2][8]. bitcoin price prediction approaches. Section 3 focuses on the
problem statement. Section 4 defines some key
Researchers use different types of machine learning methodologies used in the paper. Section 5 contains the
algorithms to make their prediction model such as Long procedure of our proposed model. Detailed implementation
331
Network to analyze the price of Bitcoin, Ethereum, and is considered as dependent. The goal of a linear regression
Ripple. Researchers use four features, and 80% instances model is to determine a linear model with loss function
form the dataset to train the model and rest 20% instances for which can be used for prediction of the price of bitcoin based
the testing [19]. on the closing price [23].
A. Perception 1
If we see the uptrend price hit back from a strong
B. Exponential Moving Average resistance level, at the same time SMA and EMA crossover
An exponential moving average (EMA) is a type of happens, the downtrend continues and breaks previous
moving average (MA) that attaches a greater weight and resistance level, then we can assume a strong downtrend may
significance to the latest data points. EMA responds to recent happen. In this scenario, we can set the SMA & EMA
price changes more significantly than a simple moving crossover point as the starting point and set the ending point
average (SMA), which applies an equal weight ‘K’ to all where it confirms a strong downtrend for training-data
observations in the period [22]. selection.
B. Perception 2
C. Linear Regression If we see the downtrend price hit back from a strong
support level, at the same time SMA and EMA crossover
An Linear regression is a simple regression model that happens, the uptrend continues and breaks previous support
makes the relationship between two variables. One variable level, then we can assume a strong uptrend may happen. In
is considered an explanatory variable and the other variable
this scenario, we can set the SMA & EMA crossover point as
332
Fig. 1. Bitcoin Price Changes during 2012- 2020 Fig. 3. Linear Regression Model on 15 days’ data
the starting point and set the ending point where it confirms a values to date and time format. After the conversion, we find
strong uptrend for training-data selection. an average price for a specific day from these 1 minute’s
We take that chunk of data to train our Linear Regression data.
Model to predict bitcoin price.
D. Data Extraction:
VI. IMPLEMENTATION We plot all daily bitcoin prices starting from December
2014 to April 2020 on the chart and in “Fig. 1”, we observe
A. Data Collection: there is a long downtrend of price from mid of 2019 till
Bitcoin historical data is taken from Kaggle which March, 2020. Recent historical prices reflect more on current
represents bitcoin price in US Dollars. The dataset has 1 prices so, we make another dataset with the prices from
minute’s data from 2014-12-01 to 2020-04-22 that equals September 2019 to February 2020. Finally, we get a total of
4363457 rows or instances and it has 8 columns or features. 182 days bitcoin closing prices showed in “Fig. 2”.
These columns are Timestamp, Open, High, Low, Close,
Volume_(BTC), Volume_(Currency), and Weighted Price E. Plotting SMA & EMA and Identify Support & Resistance
[26]. Levels:
We plot Simple Moving Average and Exponential
B. Data Pruning: Moving Average with the previous 5 days’ average price on
Our model uses the simple linear regression model to the chart showed in “Fig 2”. We can simply identify two
predict the bitcoin price and we only use the closing price of support levels and two resistance levels.
the bitcoin concerning days therefore, we delete the other 6 F. Observation for training data selection:
columns from the dataset. Some data instances have missing
values, so we also remove those instances/rows. In “Fig. 2”, we observe a sharp downtrend from the
resistance level 1 and the price holds on the support level 1.
After a false break, price again goes to uptrend to resistance
C. Data Conversion:
level 2. From the resistance level 2, price breaks the previous
Since we need the price for respective days but the support level and hold on support level 2. Again, after a false
dataset has only timestamps, so we convert these timestamp break, support level holds and the price goes to uptrend from
333
the support level 2 and passes previous support level 1 as prediction model. Researches show different approaches to
well as resistance level 2 and holds at previous resistance predict bitcoin price with the help of different machine
level 1. After a couple of days, we observe the price passing learning algorithms. However, there is a gap in
previous resistance level 2 and continues to a strong down methodologies to answer the question of which data portion
move that is also confirmed by SMA & EMA crossover. should be taken to train the prediction model to obtain a
more accurate result. We use some financial methodologies
G. Data selection: such as Simple Moving Average (SMA), Exponential
Moving Average (EMA), and two financial terminologies
1) Data Chunk 1
such as Support level, Resistance level to build our model. A
The observation has similarities with our perception 1.
Simple Linear Regression Prediction Model is trained with
We observe on the 167th day there is a SMA&EMA
our proposed data. We get accurate predictions by using the
crossover indicating the starting point of a downtrend.
data chunk proposed by our model than a random data
Hence, we select the last 15 days' price to train our linear
chunk. After training with proper data, we find that the
regression model.
prediction accuracy of our Linear Regression Model is
96.97%.
Literature review shows that bitcoin price depends on
other cryptographic and social factors, so in the future, we
have to consider other factors before training the model. We
can use other machine learning prediction algorithms with
our proposed dataset and compare accuracy.
REFERENCES
[1] L. Li, A. Arab, J. Liu, J. Liu and Z. Han, "Bitcoin Options Pricing
Using LSTM-based," in 2019 IEEE International Conference on
Blockchain (Blockchain), Atlanta, USA, 2019.
[2] A. Aggarwal, I. Gupta, N. Garg and A. Goel, "Deep Learning
Fig. 4. Price Prediction Accuracy Rate for 7 days Approach to Determine the Impact of Socio Economic Factors on
Bitcoin Price Prediction," in 2019 Twelfth International Conference
2) Data Chunk 2 on Contemporary Computing (IC3), Noida, India, India, 2019.
We also select another data chunk with the last 30 days’ [3] E. Almasri and E. Arslan, "Predicting Cryptocurrencies Prices with
price which has both uptrend and downtrend prices. The Neural Networks," in 6th International Conference on Control
Engineering & Information Technology (CEIT), Istanbul, Turkey,
second chunk of data doesn’t have any similarity with any of 2018.
our perceptions and we use this data to train our linear [4] I. A. Hashish, F. Forni, G. Andreotti and S. Darjani, "A Hybrid Model
regression model to compare accuracy and error. for Bitcoin Prices Prediction using Hidden Markov Models and
Optimized LSTM Networks," in 24th IEEE International Conference
H. Linear regression model training: on Emerging Technologies and Factory Automation (ETFA),
Zaragoza, Spain, Spain, 2019.
We train our linear regression model with the gradient [5] A. Jain, . S. Tripathi, H. D. Dwivedi and P. Saxena, "Forecasting
descent loss function where we use learning rate = 0.001 and Price of Cryptocurrencies using Tweets Sentiment Analysis," in
1000 epoch. After training with data chunk 1, we get a Eleventh International Conference on Contemporary Computing
simple linear regression line in “Fig. 3”. We predict the next (IC3), Noida, India, 2018.
consecutive day’s price with the model, then we consider [6] H. Jang and J. Lee, "An Empirical Study on Modeling and Prediction
of Bitcoin Prices with Bayesian Neural Networks Based on
that predicted price, train our model again and predict the Blockchain Information," IEEE Access, vol. 6, pp. 5427 - 5437.
next day’s price. We follow the same mechanism 7 times to
[7] S. McNally, J. Roche and S. Caton, "Predicting the Price of Bitcoin
get consecutive 7 days' bitcoin predicted price. We also Using Machine Learning," in 26th Euromicro International
follow the same steps with data chunk 2. Conference on Parallel, Distributed, and Network-Based Processing,
Cambridge, UK, 2018.
VII. RESULT [8] A. Mittal, V. Dhiman, A. Singh and C. . P. , "Short-Term Bitcoin
Price Fluctuation Prediction Using Social Media and Web Search
Data," in 2019 Twelfth International Conference on Contemporary
A. Price Prediction & Error Calculation: Computing (IC3), Noida, India, India, 2019.
We find that the linear regression model trained with data [9] P. Mohanty, D. Patel, . P. Patel and S. Roy, "Predicting Fluctuations
chunk 1 shows a higher prediction rate than data chunk 2. in Cryptocurrencies' Price using users' Comments and Real-time
Prices," in 7th International Conference on Reliability, Infocom
The linear regression prediction model along with training Technologies and Optimization (Trends and Future Directions)
data chunk 1 selected by our proposed model gives (ICRITO), Noida, India, India, 2018.
percentage error rate 3.03% which means the prediction [10] D. R. Pant, P. Neupane, A. Poudel, A. K. Pokhrel and B. K. Lama,
accuracy is 96.97%. Whereas, same linear regression "Recurrent Neural Network Based Bitcoin Price Prediction by Twitter
prediction model with randomly selected training data shows Sentiment Analysis," in 2018 IEEE 3rd International Conference on
prediction accuracy 55.11%. “Fig. 4” illustrates comparison Computing, Communication and Security (ICCCS), Kathmandu,
Nepal, 2018.
of price prediction accuracy rate for 7 days.
[11] B. M. Pavlyshenko, "Bitcoin Price Predictive Modeling Using Expert
Correction," in 2019 XIth International Scientific and Practical
VIII. CONCLUSION & FUTURE WORK Conference on Electronics and Information Technologies (ELIT) ,
Lviv, Ukraine, Ukraine, 2019.
In this paper, we propose a model that helps to determine
which data range should be taken to train a machine learning
334
[12] K. Rathan, S. . V. Sai and T. S. Manikanta, "Crypto-Currency price IEEE International Conference on Data Mining Workshops
prediction using Decision Tree and Regression techniques," in Third (ICDMW), Singapore, Singapore, Singapore, 2018.
International Conference on Trends in Electronics and Informatics [19] W. Yiying and Z. Yeze, "The 5th International Conference on
(ICOEI 2019), Tirunelveli, India, India, 2019. Information Management," in Cryptocurrency Price Analysis With
[13] S. Roy, S. Nanjiba and A. Chakrabarty , "Bitcoin Price Forecasting Artificial Intelligence, Cambridge, United Kingdom, United
Using Time Series Analysis," in 21st International Conference of Kingdom, 2019.
Computer and Information Technology (ICCIT), Dhaka, Bangladesh, [20] "Moving Average," [Online]. Available:
2018. https://en.wikipedia.org/wiki/Moving_average. [Accessed 12 06
[14] M. Saad and A. Mohaisen, "Towards Characterizing Blockchain- 2020].
based Cryptocurrencies for Highly-Accurate Predictions," in IEEE [21] "Simple Moving Average," Babypips, [Online]. Available:
INFOCOM 2018 - IEEE Conference on Computer Communications https://www.babypips.com/learn/forex/simple-moving-averages.
Workshops (INFOCOM WKSHPS), Honolulu, HI, USA, 2018. [Accessed 12 06 2020].
[15] E. Sin and L. Wang, "Bitcoin Price Prediction Using Ensembles of [22] "Exponential Moving Average," [Online]. Available:
Neural Networks," in 13th International Conference on Natural https://www.investopedia.com/terms/e/ema.asp. [Accessed 12 06
Computation, Fuzzy Systems and Knowledge Discovery, Guilin, 2020].
China, 2017.
[23] "Linear Regression," [Online]. Available:
[16] M. Wimalagunaratne and G. Poravi, "A Predictive Model for the http://www.stat.yale.edu/Courses/1997-
Global Cryptocurrency Market," in 8th International Conference on 98/101/linreg.htm#:~:text=A%20linear%20regression%20line%20has
Intelligent Systems, Modelling and Simulation, Kuala Lumpur, ,y%20when%20x%20%3D%200).. [Accessed 1212 06 2020].
Malaysia, Malaysia, 2018.
[24] "Support and Resistance Level," [Online]. Available:
[17] I. M. Wirawan, T. Widiyaningtyas and M. M. Hasan, "Short Term https://www.investopedia.com/trading/support-and-resistance-
Prediction on Bitcoin Price Using ARIMA Method," in 2019 basics/#support-and-resistance-defined. [Accessed 12 06 2020].
International Seminar on Application for Technology of Information
and Communication (iSemantic), Semarang, Indonesia, Indonesia, [25] "How to Calculate Percent Error," [Online]. Available:
2019. https://www.thoughtco.com/how-to-calculate-percent-error-609584.
[Accessed 12 06 2020].
[18] W. Chih-Hung, M. Yu-Feng, J. Chih-Chiang and L. Ruei-Shan, "A
New Forecasting Framework for Bitcoin Price with LSTM," in 2018 [26] Zielak, "Bitcoin Historical Data," 2020. [Online]. Available:
https://www.kaggle.com/mczielinski/bitcoin-historical-data.
[Accessed May 2020].
335