0% found this document useful (0 votes)
16 views

Bitcoin Trading Indicator A Machine Lear

Bitcoin Trading with Machine Learning

Uploaded by

mnaspecial
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Bitcoin Trading Indicator A Machine Lear

Bitcoin Trading with Machine Learning

Uploaded by

mnaspecial
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Bulletin of Electrical Engineering and Informatics

Vol. 12, No. 3, June 2023, pp. 1762~1772


ISSN: 2302-9285, DOI: 10.11591/eei.v12i3.4486  1762

Bitcoin trading indicator: a machine learning driven real time


bitcoin trading indicator for the crypto market

Ashikur Rahaman1, Abu Kowshir Bitto1,6, Khalid Been Md. Badruzzaman Biplob1, Md. Hasan Imam
Bijoy2, Nusrat Jahan3,4, Imran Mahmud1,5
1
Department of Software Engineering, Daffodil International University, Dhaka, Bangladesh
2
Department of Computer Science and Engineering, Daffodil International University, Dhaka, Bangladesh
3
Department of Information Technology and Management, Daffodil International University, Dhaka, Bangladesh
4
Department of Computer Engineering, University Malaysia Perlis, Arau, Malaysia
5
Graduate School of Business, Universiti Sains Malaysia, Penang, Malaysia
6
MediprospectsAI Limited, London, United Kingdom

Article Info ABSTRACT


Article history: As opposed to other fiat currencies, bitcoin has no relationship with banks.
Its price fluctuation is largely influenced by fresh blocks, news, mining
Received Jul 29, 2022 information, support or resistance levels, and public opinion. Therefore, a
Revised Sep 30, 2022 machine-learning model will be fantastic if it learns from data and tells or
Accepted Oct 18, 2022 indicates if we need to purchase or sell for a little period. In this study, we
attempted to create a tool or indicator that can gather tweets in real-time
using tweepy and the Twitter application programming interface (API) and
Keywords: report the sentiment at the time. Using the renowned Python module
"FBProphet," we developed a model in the second phase that can gather
Bitcoin historical price data for the bitcoin to US dollar (BTCUSD) pair and project
Forex trading the price of bitcoin. In order to provide guidance for an intelligent forex
Machine learning trader, we finally merged all of the models into one form. We traded with
Sentiment analysis various models for a very little number of days to validate our bitcoin
Web scraping trading indicator (BTI), and we discovered that the combined version of this
tool is more profitable. With the combined version of the instrument, we
quickly and with little error root mean square error (RMSE: 1,480.58)
generated a profit of $1,000.71 USD.
This is an open access article under the CC BY-SA license.

Corresponding Author:
Abu Kowshir Bitto
Department of Software Engineering, Daffodil International University
Dhaka, Bangladesh
Email: [email protected]

1. INTRODUCTION
A person [1] going by the name of Satoshi Nakamoto originally published one of the finest
cryptocurrencies, bitcoin, on January 9, 2009. Each bitcoin was only worth $2.26 when the bitcoin to US
dollar (BTCUSD) pair first entered the currency market. The most volatile cryptocurrency now that demands
more general attention is bitcoin. Everyone, from researchers to traders, is searching for a pricing pattern to
invest in and make the biggest return they can. Bitcoin: a peer-to-peer (P2P) electronic cash system that was
introduced as a forward-thinking electronic cash alternative on just nine pages.
On the surface, cryptocurrencies like bitcoin [2] and others resemble fiat money a lot. As with
regular money, a bitcoin can be broken into smaller pieces known as Satoshi's and used to make purchases
from businesses that take bitcoin. To store bitcoins, a user must first build a wallet. On a computer or a
mobile device, this wallet can be downloaded and installed. Some websites also offer access to online

Journal homepage: http://beei.org


Bulletin of Electr Eng & Inf ISSN: 2302-9285  1763

wallets, and some hardware vendors sell USB sticks that are actual wallet devices. These wallets come with a
bitcoin address that may be used to send or receive money. In technical terms, a bitcoin address is a hashed
representation of a public key. The corresponding private key is retained in the wallet and is encrypted and
secret [3]. The foundation of the entire bitcoin network is the blockchain, a decentralised public ledger. It
records all previous exchanges between various bitcoin addresses, including the amounts sent. This makes it
possible to determine how much money is available in each wallet. It also enables the ownership of the spent
bitcoins to be confirmed. The integrity and chronological order of the blockchain are guaranteed by
cryptography [3].
All transactions are published to the P2P network through mining [4]. Miners put a lot of time and
effort into creating hashes that meet certain criteria. The process of adding new bitcoins to circulation is
known as bitcoin mining. By resolving incredibly difficult math puzzles, new bitcoins are created through the
process of mining, which also verifies bitcoin transactions. When a bitcoin is successfully mined, the miner is
given a certain number of bitcoins.
A decentralised or over-the-counter (OTC) market for trading foreign currencies is known as the
foreign exchange market (forex, FX, or currency market) [5]. The foreign exchange rate for each currency is
set by this market. It includes all transactions involving the buying, selling, and exchanging of currencies at
set or prevailing rates. "Percentage in point" or "price interest point" is abbreviated as pip [6]. In the foreign
exchange market, it is a tiny unit of measurement that denotes a change in a currency pair. Either the stated
currency or the underlying currency may be used to represent it as a percentage. The smallest alteration in a
currency quote is represented by a standardised unit called a pip. A lot [7] is a predetermined sum of money
used along with pips to execute a trade in forex. Fortunately, a range of lot sizes are available to traders.
Typically, in order to take a deal, traders must choose the lot size. On a normal trading account for excess,
lots start at 0.0001 and can reach a maximum of 5. By putting more money into various accounts, you can
raise the size of your lots.
Natural language processing (NLP) is used in sentiment analysis [8], [9] to determine if data is
favourable, negative, or neutral. Organizations typically employ sentiment analysis on textual data to analyse
brand and product sentiment in consumer feedback and gain a better understanding of client wants. To
evaluate and derive objective quantitative findings from unprocessed text, sentiment analysis uses NLP
machine learning and other data analysis approaches. Sentiment analysis is a branch of text mining.
In 1998, one of the earliest books on stock market forecasting [10] was published. Information was
acquired by Wüthrich and associates from the Wall Street Journal, Financial Times, Reuters, and Bloomberg.
According to Borges [11] any positive or negative news is immediately absorbed by the market, and stock
prices change in accordance. Therefore, it is impossible to outperform the stock market because there are
never any undervalued stocks to buy or overvalued stocks to sell. Over extended periods, many investors,
including Warren Buffet, have been able to outperform the market. A single-layered convolutional neural
network (CNN) model was created by Cavalli and Amoretti [12] to increase earnings when the trend is
bullish and decrease losses when the market is bearish. Their creations were based on text from several social
media profiles. A trading strategy test revealed that it had superior accuracy and return compared to a single
source system [13]. An recurrent neural network (RNN)-based model was employed in a depth literature
analysis [14] to forecast the price of bitcoin based on Twitter sentiment. By using analysis, we can predict the
price of bitcoin based on the emotion of tweets that come from specific sources. I particularly like how they
use gradient descent, another machine-learning method, to extract a significant price from Twitter sentiment
analysis by using daily high and low prices from historical data. A number of machine learning techniques
are detailed in the reference paper by Colianni et al. [15] that predict the price of bitcoin. Before using their
model, they even conducted extensive literature research. They used two datasets to distribute their model.
One was for hourly data followed by time series, and the other was for daily time series data. Additionally,
they used supervised learning to classify Twitter sentiment using data from Twitter. The accuracy and
maximum result they were able to achieve using Bayesian Naive Bayes was 95% for day-basis data and
76.59% for hour-basis data. Research by Garcia and Schweitzer [16] published a companion piece. The
researchers used a trading simulation engine and two daily Twitter sentiment time series. The latter was
based on a collection of positive and negative terms from the linguistic inquiry and word count (LIWC)
lexicon, as well as the daily ratio between them.
To trade in forex, we must do a market analysis, determine the present stance of the market pair, and
make a prognosis or projection. It is difficult for one person to consider every angle because humans make
mistakes, and doing so has so far taken a lot of time. Additionally, because of how quickly time passes,
traders must act more quickly while making decisions. Therefore, our goal is to create a real-time "bitcoin"
trading indicator for the currency market that is powered by machine learning. To be more precise, we want
to predict whether we should "buy" or "sell" on the following day. We'll employ current market support and
resistance in real-time to work toward this objective. We won't purchase actual bitcoin. But we'll deal in

Bitcoin trading indicator: a machine learning driven real time bitcoin trading … (Ashikur Rahaman)
1764  ISSN: 2302-9285

bitcoin on the foreign exchange market. The tone of the tweet from the day before is the main focus. In order
to see the market trend and do a seasonal study, we also create a time series forecasting model.

2. RESEARCH METHOD
In this segment, data collection, web scraping, data handling/pre-processing, time series generation,
data analysis with forecasting, and developing BTI trading indicator has complied, which represent in
Figure 1; the details explanation is given orderly.

Figure 1. Workflow diagram of proposed study

2.1. Data collection


It is impossible to emphasise the significance of datasets in machine learning research [17]. This
study uses two different forms of data: tweets from Twitter and quantitative bitcoin price data obtained using
the Python module "tweepy" [18]. We construct the exact symbols of currency prices, such BTCUSD, using
ticker parameters. This cost is expressed as a percentage of the US dollar per bitcoin.
The current datetime for the last range of data pulling was generated using a Python datetime object.
We run the programme using the Python package "yfinance" and extract the bitcoin data in USD as our
bitcoin data for time series analysis from Figure 2. We first requested a "Twitter developer" [19] account
based on Figure 3. Using a Python module named "tweepy," we later produced consumer key,
consumerSecret, accessToken, and accessSecret to authenticate on Twitter. In this instance, the search phrase
included the hashtags #bitcoin and #bitcoin. However, in order to balance my dataset and maintain data
uniqueness, we filtered retweets. We still entered dates manually into our application. Users must enter the
year, month, and day. Due to the bitcoin market's extreme volatility and frequent movements, we typically
create 2,000 rows of pertinent tweets for the previous day. Tweets that are saved as string data with indexes
ranging from 0 to 1,999. Tables 1 and 2 provide a sample dataset.

Figure 2. Bitcoin data extraction procedure diagram

Bulletin of Electr Eng & Inf, Vol. 12, No. 3, June 2023: 1762-1772
Bulletin of Electr Eng & Inf ISSN: 2302-9285  1765

Figure 3. Tweet data extraction procedure diagram

Table 1. Sample data for bitcoin data


Date Close Volume
9/17/2014 457.3340149 21056800
9/18/2014 424.4400024 34483200
9/19/2014 394.79599 37919700

Table 2. Sample data for tweet data


Index Tweets
1 RT @xZ3R0x_: $CPHX is pumping! 🠓ˆ#ETH gas fees are low! The 1st January another airdrop of Phoenix Coin
for all @Phoenix_Crypto_ holders…
2 RT @BTC_Archive: The government just prints money...and doesn’t seem to have any consequences. They
can’t make more #Bitcoin - Billionaire…

2.2. Data pre-processing


Before the arrangement takes place, data pre-handling is an essential task. For bitcoin, "yfinance"
[20] is a very rich library that provides those data in a suitable style, so we do not need to fill in any kind of
rows with a simple imputer. Since the bitcoin market is open around-the-clock, there is no risk of seasonal
statistics being broken. To normalise the data, it was standardised to convert from 0 to 1. Next, the tweet data
that we are collecting through the Twitter application programming interface (API) is distorted by several
superfluous symbols, capitalization, or even new lines and hyperlinks [21]. It will be horrible if we manually
clean up by capturing each row of tweets. We developed a technique to extract a pandas data frame and apply
a function to eliminate new lines, hashtags (#), letter formatting, and hyperlinks that contain the http symbol
because of this. We must save every tweet in a new data column after the tweets have been cleansed. For that
reason, we can create a new column to hold all cleaned-up tweets. Table 3 now includes the sample data with
clean tweets following the preprocessing of the twitter data.

Table 3. Tweet data after preprocess


Index Raw tweets Clean tweets
1 RT @xZ3R0x_: $CPHX is pumping ! 📈#ETH gas fees RT @xZ3R0x_: $CPHX is pumping ! 📈TH gas fees are low
are low !The 1st January another airdrop of Phoenix Coin ! The 1st January another airdrop of Phoenix Coin for all
for all @Phoenix_Crypto_holders… @Phoenix_Crypto_holders…
2 RT @BTC_Archive: the government just prints money and RT @BTC_Archive: the government just prints money and
doesn’t seem to have any consequences. They doesn’t seem to have any consequences. They can’t
can’t make more #bitcoin-Billionaire… make more bitcoin-Billionaire…

2.3. Data feature generating


We cleaned up the tweets, and as a result, several data columns about cleaned tweets have been
generated. We first retrieve each row's subjectivity. The subjective scale ranges from (-1) to (+1). Higher
subjectivity is indicated by a value near +1. A value nearer to -1 denoted less subjectivity. In order to shed
insight on the subjectivity of tweets relating to bitcoin, this subjectivity column was pulled from the cleaned
tweets column. More subjectivity means a bigger impact. The majority of tweets have subjectivity levels
above 0.50 and significantly affect the market. Polarity is a different column that displays the strength of the
subjectivity. Let's discuss the first tweet from our collection. As you can see, it has 0.1 subjectivity but 0.00
polarity. The tweet has less subjectivity and no market linkage, which is why polarity there displays as 0. We
chose tweets that would be more polarising and subject to do an excellent sentiment analysis.

2.4. Sentiment generating using TextBlob


A Python package for text processing is called TextBlob [22]. It provides a fundamental API for
doing common NLP tasks, such as part-of-speech tagging, noun phrase extraction, sentiment analysis,
classification, and translation, among others [23]. It is easier to understand and more enticing. We use
sentiment analysis to extract subjectivity, followed by polarity to determine the range of each subjective

Bitcoin trading indicator: a machine learning driven real time bitcoin trading … (Ashikur Rahaman)
1766  ISSN: 2302-9285

tweet. This is because, when performing our operation that will produce more realistic outcomes when it
comes to conducting Forex or stock market trading, we require the total number of tweets. The movement of
a currency like Bitcoin on the FX market is correlated with public opinion. Therefore, if a trader can in some
way comprehend the current mood, they can in some way comprehend market tendencies to execute their
transaction.
The sentiment polarity of the element, which decides whether the text conveys the user's positive,
negative, or neutral feeling about the subject, defines the orientation of the stated emotion, which is between
[-1,1]. Subjectivity [24] exists between [0, 1]. Subjectivity is a metric used to determine how much of a text
is made up of fact and personal opinion. The text is more subjective than usual; therefore, it offers personal
opinions rather than objective information. We can begin writing the function to create a Sentiment class
once we have determined the subjectivity and polarity of a data collection. I utilised the sentiment classes
positive, negative, and neutral in this instance. Polarity is defined as "positive" if it is greater than 0 and
"negative" if it is less than 0. Sometimes it might be 0, in which case the sentiment class will be displayed as
"neutral". For our tool, this sentiment class is crucial. since judgements made by the computer will be based
on this class. The entire algorithm could deliver incorrect information if our sentiment analysis is flawed. If
that occurs, we might suffer a large financial loss.
We can filter tweets about subjectivity to get some more ordinal results. The outcome might be more
appealing if we filter away tweets with more subjectivity. Table 4 details the Sentiment class and the filtered
tweets dataset.

Table 4. Subjectivity and polarity results for tweet dataset


Index Tweets Cleaned tweets Subjectivity Polarity Sentiment
1 RT @intocryptoverse: #bitcoin great RT @intocryptoverse: bitcoin great 0.75 0.8 Positive
accumulation: lessons from the stock accumulation: lessons from the stock
market https://t.co/XH4ao5KgZv market
2 RT @xZ3R0x_: $CPHX is pumping ! 📈 RT @xZ3R0x_: $CPHX is pumping ! 0.3 0 Neutral
#ETH gas fees are low ! The 1st January 📈TH gas fees are low ! The 1st January
another airdrop of Phoenix Coin for all another airdrop of Phoenix Coin for all
@Phoenix_Crypto_holders… @Phoenix_Crypto_holders…
3 RT @RepTedBudd: given RT @RepTedBudd: Given 0.433333 -0.28333 Negative
@BrianBrooksUS's previous experience as @BrianBrooksUS's previous experience as
head of the OCC, I asked him if the U.S. head of the OCC, I asked him if the U.S.
government is "behind the curve" whe… government is "behind the curve" whe…

2.5. Facebook prophet


A piecewise linear or logistic growth curve trend is one of the four fundamental parts of the Prophet
process, an additive regression model. Prophet chooses change points from the data to automatically detect
changes in trends. an annual seasonal element that is modelled using fourier series. The decomposable time
series model used by FBProphet [25] has three main parts: seasonal, trends, holidays or events influence, and
error, as shown in "(1)".

𝑓(𝑥) = 𝑔(𝑥) + 𝑠(𝑥) + ℎ(𝑥) + 𝑒(𝑡) (1)

FBProphet utilises a linear model to match the data, but by adjusting its parameters, it can convert to
a nonlinear model (logistics growth). By default, FBProphet fits our model into a linear model. Some things
will be fully realised as prediction technology advances. Carrying capacity is what it is known as, and the
anticipated increase should reach it. Time-series forecasting is the process of building a model to forecast
future values based on recent and historical time-series data.
Therefore, the first thing we must do is to get the data. The Prophet demands that we change the
name of the "date" column to "ds" and that we call our y-column just "y." Although Prophet does most of its
work in the background, there are a few hyperparameters that let us easily adjust our models. To work with
FB-Prophet in this instance, i used the "date" column as "ds" and the "close" column as "y". The intended
data set's head portion is depicted in Figure 4(a).
Once the data has been generated, we can now use Prophet's forecast method to obtain other
forecasted variables. Figure 4(b) shows "yhat," which is the anticipated closing price, "yhat lower," which
stands for the day's support, and "yhat upper," which stands for the day's resistance. The "ds" column,
specifically, represents the future date.

Bulletin of Electr Eng & Inf, Vol. 12, No. 3, June 2023: 1762-1772
Bulletin of Electr Eng & Inf ISSN: 2302-9285  1767

(a) (b)

Figure 4. Data (a) preparation for FBProphet and (b) forecast data using FBProphet

2.6. Performance measure (error/accuracy)


The method of mean absolute error (MAE), mean squared error (MSE), root mean square error
(RMSE), and model correctness are used to assess the performance of the models [26]. The MAE in a
measurement is the sum of the errors. The same event is expressed by the measurement of errors between the
paired observations. Additionally, it highlights the discrepancies between measured and real values. It is the
arithmetic average of the total absolute error. Include variations between predicted and observed values in the
Y versus X example. "(2)" is the formula for MAE.
1
𝑀𝐴𝐸 = ∑𝑛𝑖=1 |𝑥𝑖 − 𝑥| (2)
𝑛

Here, n denotes the number of errors, |𝑥𝑖 − 𝑥| the absolute errors, and the summation sign (it means
to add all). The MSE of the estimator determines the average squared error in statistics. The true value and
the estimated value are contrasted using the average squared. It demonstrates how close a regression line
must be to a group of points. The distance from the regression line point demonstrates this, followed by a
square. All of the negative value is turned positive by this square. We determine the square of error using
MSE. "(3)" is the formula for MSE.
1
𝑀𝑆𝐸 = ∑𝑛𝑖=1 |𝐴𝑐𝑡𝑢𝑎𝑙 − 𝑓𝑜𝑟𝑐𝑎𝑠𝑡|2 (3)
𝑛

Here, n is the number of elements, is the sum, actual is the original y-value, and forecast is the
regression y-value. The RMSE stands for the standard deviation of prediction error. We can determine the
locations of the data points on the regression line using residuals or prediction error. The RMSE method
determines how large these prediction mistakes are. It demonstrates how closely the data are related to the
best fitting line. RMSE is typically used in climatology, regression analysis, and forecasting to validate
experimental results. "(4)" is the formula for RMSE.

1
𝑅𝑀𝑆𝐸 = √ ∑𝑛𝑖=1 |𝑠𝑖 − 𝑜𝑖 |2 (4)
𝑛

Here, oi =observations, si =variables predicted values, n=Observations number for analysis which
is available.

3. RESULTS AND DISCUSSION


3.1. Time series analysis
The breakdown of the daily bitcoin price following "2014-09-17" is depicted in Figure 5. The first
graph displays the recent increase in the price of bitcoin after 2018. The year is indicated on the x-axis, and
the y-axis displays the daily "close" price of bitcoin. The tendency for a time series to generally increase,
decrease, or get worse across the entire dataset. It is also known as the time series' gradual evolution.
The "ds" chart displays the daily basis seasonal variation of the price of bitcoin. As we can see,
when the market opened at 0:00 Greenwich mean time (GMT), or 6:00 AM Bangladesh time, the price was at
its lowest point. It takes 4 hours for something to move up from one position, and the final 4 hours are when
it moves down to the lowest position of the day. The yearly and weekly fluctuations in the price of bitcoin in
relation to the dataset are displayed on two more random charts that are also random. If we examine the "day
of the week" chart, we can see that its price increases most on friday.

Bitcoin trading indicator: a machine learning driven real time bitcoin trading … (Ashikur Rahaman)
1768  ISSN: 2302-9285

Figure 5. Decomposition of daily additive bitcoin price

3.2. Prediction target as close price


The daily close price of bitcoin in USD is thought to be the main focus of this effort. The bitcoin
trade marketplaces, which were considered to be the end of lengthy financial exchanges, are open every day
of the week, 24/7, throughout the entire year. Temporary closures for support and updates are the main
exception. As a result, the price of bitcoin fluctuates quickly between trade markets. The website
coinmarketcap.com reported 16,123 distinct digital currency transaction markets as of January 2019. The
significance of a local pricing could be incorrect due to the continually open business hours. On this record,
the current price is equal to the maximum distance of the projected 23:59 coordinated universal time (UTC)
last trading moment for every day.

3.2. Bitcoin trading indicator


Our BTI was created by combining several techniques such as site scraping, sentiment analysis on
Twitter, and cryptocurrency prediction values. The act of retrieving a website and gathering data from it is
known as web scraping. When a user visits a website, a browser downloads the page, a process known as
fetching. Web crawling is therefore a crucial component of web scraping because it enables us to gather
pages for further processing.
We utilised the well-known Python module "BeautifulSoup" version 4 to extract helpful data from
numerous websites. Without using any machine learning models, we traded by using the ecrowdwisdom.live
URL. This website is useful for making predictions about bitcoin and other cryptocurrencies. In the end, its
forecasted outcome is favourable and is well received by many traders. Figure 6 illustrates the fundamental
workings of Python-based web scraping. We combine our model with data from our sentiment analysis of
tweets from earlier days, anticipated data visualisation, and web scraping technologies to create a useful tool
that can provide a signal for short-term trading. Figure 7 shows an illustration of our whole model.

Figure 6. Web page data scraping basic mechanism

Bulletin of Electr Eng & Inf, Vol. 12, No. 3, June 2023: 1762-1772
Bulletin of Electr Eng & Inf ISSN: 2302-9285  1769

Figure 7. The BTI

3.3. Performance measurement


Now, our constructed model can perform well with a low error rate in terms of model correctness.
Table 5 shows the MAE, MSE, and RMSE. We created three different systems that geared up the final model
after compiling the BTI into data. The results of a $1,000 USD cryptocurrency market deposit. Table 6 shows
the deposit value, profit, and remaining balance for the four developed models.

Table 5. Model performance metrics


Model Name MAE MSE RMSE
Bitcoin’s sentiment analysis using TextBlob 13140.41 220262701.56 14841.25
Time series forecasting using FBProphet 2084.47 12745971.02 3570.15
Web scrapping (by following internet) 2167.96 12661285.40 3758.27
The final model (combined version) 914.74 2192117.14 1480.58

Table 6. Findings of all implemented models


Model Name Deposit ($) Profit ($) Remain Balance ($)
Bitcoin’s sentiment analysis using TextBlob 1,000 439.65 1,439.65
Time series forecasting using FBProphet 1,000 -1000 000
Web scrapping (by following internet) 1,000 128 1128
The final model (combined version) 1,000 1,000.71 2,000.71

Table 6 demonstrates that the combined model's profitability is the highest. That implies that
bitcoin's price movement is not only dependent on a single element; rather, there are a number of additional
factors that might influence the market's direction. The first model only generates tweets and examines
sentiment analysis of tweets using #bitcoin to see if it produces output in three categories. which are polar
opposites, positive, and neutral. Although we can make some money there, it is insufficient for professional
trading. Time series forecasting with FBProphet can provide market trends and other time series forecasting
details, however employing this method exclusively would not be a suitable strategy because there are very
few shortcomings in it.

3.4. Prediction and indicator


Figure 8 depicts the outcome after combining all trading logic into an if/else condition. A non-
technical person may easily utilise it, and as i already indicated, we employed an online learning system to
collect real-time qualitative and quantitative data sets. Even the support and resistance pip counts coming
from a stable web platform.
We attempted to signal trading using our bitcoin data from our BTI indicator. The trades in Table 7
are shown together with their open time, types, size, price, T/P value, and close time. We demonstrate the
profit and highlight the buy or sell types using the BTI indicator.

Bitcoin trading indicator: a machine learning driven real time bitcoin trading … (Ashikur Rahaman)
1770  ISSN: 2302-9285

Figure 8. Bitcoin prediction and visualization from final model

Table 7. Trading statement summary using BTI indicator


No Trade Open time Type Size Price T/P Close time Profit BTI indicator
1 2183156 2021.11.06 11:16:22 buy 0.05 60437.95 61399.82 2021.11.06 21:22:20 46.48 Buy
2 1505512 2021.10.30 19:18:14 sell 0.2 61567.89 61450.19 2021.10.30 22:16:56 23.54 Sell

4. CONCLUSION
We demonstrated that price movement can be predicted by the overall mood analysis. To
accomplish our main objective, we added up all subjective polarity and divided it by the size of the data
frame to maintain a polarity between -1 and +1. The final step of this analysis is a function that determines
our options. In order to achieve our goal, we evaluated our model by combining it with other variables. In
order to provide more details about the BTCUSD market, we generally gathered certain site material and
extracted historical pricing data. Additionally, when needed, our model is able to detect and retrieve the
current date. The study's most important finding was that we were able to profit by $1,000.71 USD in just 10
days with little error (RMSE: 1480.58) using the combined version of the programme. At a glance, we can
state that Twitter sentiment analysis can provide sentiment towards the state of the market, and other data can
provide entry and exit points for a certain trade.

REFERENCES
[1] S. Nakamoto, “Bitcoin: A peer-to-peer electronic cash system,” Decentralized Business Review. pp. 1–9, 2008.
[2] R. Böhme, N. Christin, B. Edelman, and T. Moore, “Bitcoin: Economics, technology, and governance,” Journal of Economic
Perspectives, vol. 29, no. 2, pp. 213–238, May 2015, doi: 10.1257/jep.29.2.213.
[3] H. Vranken, "Sustainability of bitcoin and blockchains," Current opinion in environmental sustainability, vol. 28, pp. 1-9, 2017,
doi: 10.1016/j.cosust.2017.04.011.
[4] R. Böhme, N. Christin, B. Edelman, and T. Moore, "Bitcoin: Economics, technology, and governance," Journal of economic
Perspectives, vol. 29, no. 2, pp. 213-238, 2015, doi: 10.1257/jep.29.2.213.
[5] M. D. D. Evans, "Forex trading and the WMR fix," Journal of Banking & Finance, vol. 87, pp. 233-247, 2018, doi:
10.1016/j.jbankfin.2017.09.017.
[6] A. Hayes, “What are Pips in Forex trading and what is their value?,” Investopedia, 2022.
https://www.investopedia.com/terms/p/pip.asp (accessed May 11, 2022).
[7] J. Chen, “What is standard lot? definition in Forex and calculating lots,” Investopedia, 2020.
https://www.investopedia.com/terms/s/standard-lot.asp (accessed May 11, 2022).
[8] S. Gupta, “Sentiment analysis: Concept, analysis and applications,” Towards data science, 2018.
https://towardsdatascience.com/sentiment-analysis-concept-analysis-and-applications-6c94d6f58c17 (accessed May 12, 2022).
[9] R. J. Lia, A. B. Siddikk, F. Muntasir, S. S. M. M. Rahman, and N. Jahan, “Depression detection from social media using Twitter’s
tweet,” in Big Data Intelligence for Smart Applications, 2022, pp. 209–226, doi: 10.1007/978-3-030-87954-9_9.
[10] B. Wuthrich, V. Cho, S. Leung, D. Permunetilleke, K. Sankaran, and J. Zhang, “Daily stock market forecast from textual web
data,” in SMC’98 Conference Proceedings. 1998 IEEE International Conference on Systems, Man, and Cybernetics (Cat.
No.98CH36218), 1998, pp. 2720–2725, doi: 10.1109/ICSMC.1998.725072.
[11] M. R. Borges, “Efficient market hypothesis in European stock markets,” The European Journal of Finance, vol. 16, no. 7, pp.
711–726, Oct. 2010, doi: 10.1080/1351847X.2010.495477.

Bulletin of Electr Eng & Inf, Vol. 12, No. 3, June 2023: 1762-1772
Bulletin of Electr Eng & Inf ISSN: 2302-9285  1771

[12] S. Cavalli and M. Amoretti, “CNN-based multivariate data analysis for bitcoin trend prediction,” Applied Soft Computing, vol.
101, pp. 1–13, Mar. 2021, doi: 10.1016/j.asoc.2020.107065.
[13] Y. Zhai, A. Hsu, and S. K. Halgamuge, “Combining news and technical indicators in daily stock price trends prediction,” in
International Symposium on Neural Networks, 2007, pp. 1087–1096, doi: 10.1007/978-3-540-72395-0_132.
[14] D. R. Pant, P. Neupane, A. Poudel, A. K. Pokhrel, and B. K. Lama, “Recurrent neural network based Bitcoin price prediction by
Twitter sentiment analysis,” in 2018 IEEE 3rd International Conference on Computing, Communication and Security (ICCCS),
Oct. 2018, pp. 128–132, doi: 10.1109/CCCS.2018.8586824.
[15] S. Colianni, S. Rosales, and M. Signorotti, “Algorithmic trading of cryptocurrency based on Twitter sentiment analysis,” CS229
Project, vol. 1, no. 5, pp. 1–5, 2015.
[16] D. Garcia and F. Schweitzer, “Social signals and algorithmic trading of Bitcoin,” Royal Society Open Science, vol. 2, no. 9, pp. 1–
13, Sep. 2015, doi: 10.1098/rsos.150288.
[17] A. K. Bitto and I. Mahmud, “Multi categorical of common eye disease detect using convolutional neural network: a transfer learning
approach,” Bulletin of Electrical Engineering and Informatics, vol. 11, no. 4, pp. 2378–2387, Aug. 2022, doi: 10.11591/eei.v11i4.3834.
[18] J. Abraham, D. Higdon, and J. Nelson, “Cryptocurrency price prediction using tweet volumes and sentiment analysis,” SMU Data
Science Review, vol. 1, no. 3, pp. 1–21, 2018.
[19] K. S. Madhu, B. C. Reddy, C. Damarukanadhan, M. Polireddy, and N. Ravinder, “Real time sentimental analysis on Twitter,” in
2021 6th International Conference on Inventive Computation Technologies (ICICT), Jan. 2021, pp. 1030–1034, doi:
10.1109/ICICT50816.2021.9358772.
[20] A. K. Bitto et al., “CryptoAR: scrutinizing the trend and market of cryptocurrency using machine learning approach on time series
data,” Indonesian Journal of Electrical Engineering and Computer Science, vol. 28, no. 3, pp. 1684–1696, Dec. 2022, doi:
10.11591/ijeecs.v28.i3.pp1684-1696.
[21] K. Makice, Twitter API: Up and running: Learn how to build applications with the Twitter API. Sebastopol: "O’Reilly Media, Inc, 2009.
[22] B. S. Shekhawat, “Sentiment classification of current public opinion on BREXIT: Naïve Bayes classifier model vs Python’s
TextBlob approach,” M.S. thesis, Dept. Sci. in Data Analytics, National College of Ireland, Dublin, Ireland, 2019.
[23] S. Rahman, N. Jahan, F. Sadia, and I. Mahmud, “Social crisis detection using Twitter based text mining-a machine learning approach,”
Bulletin of Electrical Engineering and Informatics, vol. 12, no. 2, pp. 1069–1077, Apr. 2023, doi: 10.11591/eei.v12i2.3957.
[24] A. Szabolcsi, “Positive polarity–negative polarity,” Natural Language & Linguistic Theory, vol. 22, no. 2, pp. 409–452, May
2004, doi: 10.1023/B:NALA.0000015791.00288.43.
[25] R. K. Jana, I. Ghosh, and M. W. Wallin, “Taming energy and electronic waste generation in bitcoin mining: Insights from
Facebook prophet and deep neural network,” Technological Forecasting and Social Change, vol. 178, p. 121584, May 2022, doi:
10.1016/j.techfore.2022.121584.
[26] M. A. Rubi, H. I. Bijoy, and A. K. Bitto, “Life expectancy prediction based on GDP and population size of Bangladesh using
multiple linear regression and ANN model,” in 2021 12th International Conference on Computing Communication and
Networking Technologies (ICCCNT), Jul. 2021, pp. 1–6, doi: 10.1109/ICCCNT51525.2021.9579594.

BIOGRAPHIES OF AUTHORS

Ashikur Rahaman received his undergraduate degree in Software Engineering


Major in Data Science at Daffodil International University (DIU), Dhaka, Bangladesh. He
is currently attending Universal Immigration and Education Consultancy Ltd as a Software
Engineer. His research experience and interest now in crypto market and data science. He
can be contacted at email: [email protected].

Abu Kowshir Bitto received his undergraduate degree in Software


Engineering Major in Data Science at Daffodil International University (DIU), Dhaka,
Bangladesh. He is currently attending MediprospectsAI as a Research and Development
Engineer. He is member of International Association of Engineers. He is a Chief Human
Resource Executive (CHRE) at Virtual Multidisciplinary Research Lab. He previously
worked as a Research Assistant at the Data Science Lab DIU. He is an energetic, focused
and hard working person since his student life. His research experience and interest now in
computer vision, data science, and natural language processing. He can be contacted at
email: [email protected].

Khalid Been Md. Badruzzaman Biplob pursued his bachelor's degree and
Master of Science in Computer Science and Engineering (CSE) at Daffodil International
University (DIU), Dhaka, Bangladesh. Currently he is working as a Senior Lecturer in
Software Engineering department at DIU. He is doing his Ph.D in Education from
University Sains Islam, Malaysia. His area of interest includes machine learning, deep
learning, and educational research. He can be contacted at email:
[email protected].

Bitcoin trading indicator: a machine learning driven real time bitcoin trading … (Ashikur Rahaman)
1772  ISSN: 2302-9285

Md. Hasan Imam Bijoy pursued his bachelor's degree (B. Sc) in Computer
Science and Engineering (CSE) at Daffodil International University (DIU), Dhaka,
Bangladesh. Currently he is working as a Lecturer in CSE department at DIU. He is a
Convener of the Virtual Multidisciplinary Research Lab. He is a research zealot, having
published over 15 conference papers, 4 journal publications, and one programming book (A
Handbook of C Programming with Example). His area of interest includes machine
learning, deep learning, computer vision, natural language processing, image processing,
internet of things, and so many field. He can be contacted at email: hasan15-
[email protected].

Nusrat Jahan is Assitant Professor and head of Department of Information


Technology and Management in Daffodil International University, Dhaka, Bangladesh. She
is currently pursuing her Ph.D from School of Computer and Communication Engineering,
Universiti Malaysia Perlis (UniMAP). Shecompleted her M.Sc. and B. Sc. in IT from
Institute of Information Technology, Jahangirnagar University. Her research interests are
distributed database system, machine learning, data mining, internet of things (IoT) and
management information system (MIS). She can be contacted at email:
[email protected].

Dr. Imran Mahmud is an Associate professor and head of the Department of


Software Engineering (SWE) at Daffodil International University. He is also an adjunct
professor at the Graduate School of Business, Universiti Sains Malaysia. Dr. Imran is an
expert in business analytics, technology management, and structural equation modeling. He
can be contacted at email: [email protected].

Bulletin of Electr Eng & Inf, Vol. 12, No. 3, June 2023: 1762-1772

You might also like