Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 66

PROJECT REPORT

ON

“CryptoChart – Cryptocurrency Price Tracker”


Project work submitted as partial fulfilment of the course for the award of the degree

BACHELOR OF COMPUTER APPLICATIONS

OF

BANGALORE UNIVERSITY

Bangalore-560056,Karnataka,India

Submitted by

SRIHARSHA S A [19UHSB7074]

In partial fulfilment of the requirements of the VI semester

Bachelor Of Computer Application

By

Under the guidance of

Mrs.Manasa.K.N
Asst. Professor, Dept. of Computer Applications

East West College Of Management


No 63 off from Magadi road,Vishwaneedam post,Bangalore-91
East West College of Management
No 63 off from Magadi road,Vishwaneedam post,Bangalore-91

CERTIFICATE
This is to certify that SRIHARHA S A [19UHSB7074] of VI semester BCA has
satisfactorily completed his project entitled “CryptoChart – Cryptocurrency
Price Tracker” in our institution as a partial fulfilment of requirement for the
award of degree in Bachelor of Computer Application awarded by the Bangalore
university during the year MAY 2022 to SEP 2022 .

Signature of the guide Signature of HOD

Signature of Examiner
DECLARATION

I, hereby that the work which is begin presented in the project


entitled“CryptoChart – Cryptocurrency Price Tracker”
in partial fulfilment of the requirement for the award of degree Bachelor of Computer
Application Submitted in the Department of Computer Science East West College of
Management is an authentic record of our own work carried out under the supervision and guidance
of Mrs.Vachana Asst. Professor, Department of Computer Applications East West College of
Management.

The matter embodied in this work has not been submitted for the awarded any other degree.

SRIHARSHA S A[19UHSB7074]
ACKNOWLEDGEMENT

It is not exaggeration to say that the emergency of this book was outcome of absorbing work. It not
only involved the days of effort but also complete concentration, extension consultation, case study,
analysis, support from the concerned guide.

I take this opportunity to express our sincere thanks to our HOD, professor Shailesh Prasad for
giving us opportunity and encouraging us for developing the project. I would like to thank our
internal guide Mrs.Vachana , Asst professor , Department of Computer Applications for
providing her valuable suggestion, support, spontaneous encouragement and constant help in
improving the presentation of this project.

Finally, I would like to thank my parent and all our classmates, who have contributed directly
or indirectly in our efforts to complete this project successful
ABSTRACT
A cryptocurrency price tracker monitors the current value of different
digital currencies and tokens. Many of these services provide historical
data as well, allowing users to compare current prices against older values.
And a section that predicts the future price based on the older price records.
Currently people are more interested in investing towards different kinds of
crypto currency so this application will provide the baseline for them to get
started with investing in cryptocurrency.

Investors routinely spend a lot of time searching for the latest coins, the one
with the most exciting prospects or the one that's the most undervalued.
Savvy investors also look to different cryptocurrency exchanges,
applications, and services to maximize their investment potential. But fewer
individuals who invest time and money into the cryptocurrency space spend
an adequate amount of time considering the impact that price tracker has on
their experience. So, by using this application investors will know all the
information they need prior buying the cryptocurrencies like current price,
market cap, older price comparisons etc. by constantly updating the data.

We are also predicting the future price. As financial institutions begin to


embrace artificial intelligence, machine learning is increasingly utilized to
help make trading decisions. Although there is an abundance of stock data
for machine learning models to train on, a high noise to signal ratio and the
multitude of factors that affect stock prices are among the several reasons
that predicting the market difficult. At the same time, these models don’t
need to reach high levels of accuracy because even 60% accuracy can deliver
solid returns. One method for predicting stock prices is using a long short-
term memory neural network (LSTM) for times series forecasting.
TABLE OF CONTENTS
ACKNOWLEDGEMENT.........................................................................................................3
ABSTRACT............................................................................................................................4
INTRODUCTION...................................................................................................................1
1.1 Existing System.................................................................................................................... 2
1.2 Proposed System.................................................................................................................. 2
1.2.1 Scope of the Work.........................................................................................................3
1.2.2 Problem Statement.......................................................................................................3
1.3 Objectives............................................................................................................................. 4
LITERATURE SURVEY...........................................................................................................5
2.1 Abstract................................................................................................................................ 5
2.2 Introduction......................................................................................................................... 5
2.4 Research methodology........................................................................................................7
2.5 Cryptocurrency and how it works........................................................................................7
SYSTEM REQUIREMENT SPECIFICATIONS...........................................................................9
3.1 Hardware and Software Requirements...............................................................................9
3.1.1 Software requirements.................................................................................................. 9
3.1.2 Hardware requirements................................................................................................9
3.2 Functional Requirements...................................................................................................10
3.3 Non-Functional Requirements...........................................................................................10
SYSTEM DESIGN.................................................................................................................12
4.1 Iterative model design.......................................................................................................12
4.2 App Development.............................................................................................................. 13
4.3 System Architecture........................................................................................................... 14
4.4 Flow Chart.......................................................................................................................... 15
4.5 Class Diagram..................................................................................................................... 16
SYSTEM IMPLEMENTATION..............................................................................................17
5.1 Machine Learning............................................................................................................... 17
SYSTEM TESTING...............................................................................................................22
6.1 Introduction....................................................................................................................... 22
6.1.1 Verification.................................................................................................................. 22
6.1.2 Validation.................................................................................................................... 23
6.2 Testing Process................................................................................................................... 23
6.3 Testing Plan........................................................................................................................ 23
6.4 Test strategy...................................................................................................................... 24
6.4.1 Phases of Testing......................................................................................................... 24
6.5 Unit Testing........................................................................................................................ 25
6.5.1 Benefits of Unit testing...............................................................................................25
6.7 Unit Test Cases................................................................................................................... 26
6.8 Integration Test Cases........................................................................................................29
SNAPSHOTS AND RESULTS................................................................................................30
...................................................................................................................................31
CONCLUSION.....................................................................................................................33
REFERENCES.......................................................................................................................35
TABLE OF FIGURES

Table No Table Name Page No


Table 1 Unit Test case 1 26

Table 2 Unit Test case 2 26

Table 3 Unit Test case 3 26

Table 4 Unit Test case 4 27

Table 5 Unit Test case 5 27

Table 6 Unit Test case 6 27

Table 7 Unit Test case 7 28

Table 8 Unit Test case 8 28

Table 9 Integration Test case 1 29


LIST OF TABLES
Figure No Figure name Page No
Figure 4.1 Incremental model 12

Figure 4.2 Architecture diagram 14

Figure 4.3 Flow Chart 15

Figure 4.4 Class Diagram 16

Figure 5.1 Structure of LSTM 18

Figure 5.2 Forget Gate 19

Figure 5.3 Input gate 19

Figure 5.4 Input gate 20

Figure 5.5 LSTM State Diagram 20


API data Obtained From Yahoo
Figure 5.6 21
Finance API
Graph plotted between actual and
Figure 5.7 21
predicted price using LSTM model
CryptoChart-Cryptocurrency Price

CHAPTER 1

INTRODUCTION
A cryptocurrency is a digital or virtual currency that is secured by cryptography,
which makes it nearly impossible to counterfeit or double-spend. Many
cryptocurrencies are decentralized networks based on blockchain technology—a
distributed ledger enforced by a disparate network of computers. A defining feature of
cryptocurrencies is that they are generally not issued by any central authority,
rendering them theoretically immune to government interference or manipulation. To
use cryptocurrencies, we need a cryptocurrency wallet. These wallets can be software
that is a cloud-based service or is stored on your computer or on your mobile device.
The wallets are the tool through which you store your encryption keys that confirm
your identity and link to your cryptocurrency.

Cryptocurrency comes under many names. You have probably read about some of the
most popular types of cryptocurrencies such as Bitcoin, Litecoin, and Ethereum.
Cryptocurrencies are increasingly popular alternatives for online payments. Before
converting real dollars, euros, pounds, or other traditional currencies into □ (the
symbol for Bitcoin, the most popular cryptocurrency), you should understand what
cryptocurrencies are, what the risks are in using cryptocurrencies, and how to protect
your investment.

Cryptocurrencies are still relatively new, and the market for these digital currencies is
very volatile. Since cryptocurrencies don't need banks or any other third party to
regulate them; they tend to be uninsured and are hard to convert into a form of
tangible currency (such as US dollars or euros.) In addition, since cryptocurrencies are
technology-based intangible assets, they can be hacked like any other intangible
technology asset. Finally, since you store your cryptocurrencies in a digital wallet, if
you lose your wallet (or access to it or to wallet backups), you have lost your entire
cryptocurrency investment.

Dr. AIT, Dept of 2021- 1


CryptoChart-Cryptocurrency Price

Follow these tips to protect your cryptocurrencies:

 Look before you leap! Before investing in a cryptocurrency, be sure you understand how it
works, where it can be used, and how to exchange it. Read the webpages for the currency
itself (such as Ethereum, Bitcoin or Litecoin) so that you fully understand how it works, and
read independent articles on the cryptocurrencies you are considering as well.

Dr. AIT, Dept of 2021- 2


CryptoChart-Cryptocurrency

 Use a trustworthy wallet. It is going to take some research on your part to choose the right
wallet for your needs. If you choose to manage your cryptocurrency wallet with a local
application on your computer or mobile device, then you will need to protect this wallet at a
level consistent with your investment. Just like you wouldn't carry a million dollars around in
a paper bag, don't choose an unknown or lesser-known wallet to protect your cryptocurrency.
You want to make sure that you use a trustworthy wallet.

 Have a backup strategy. Think about what happens if your computer or mobile device (or
wherever you store your wallet) is lost or stolen or if you don't otherwise have access to it.
Without a backup strategy, you will have no way of getting your cryptocurrency back, and
you could lose your investment.

1.1 Existing System


One of the remarkable financial forms that have been emerged in the past few years is
Cryptocurrency. Hence, Several Price Tracking applications has been developed in the
market such as "livecoinwatch" & "delta.app" but they are in not able to provide
accurate tracking stats of coins. They are limited to the coins i.e they don't showcase
the history of the coins and variety of coins. The application interfaces are complex
and some of them charge while signing up into the app. They provide limited services
and don't support transactions or crypto trading i.e they don't have features to sync up
with other cryptocurrency applications. No portfolio system is add to list the favourite
coins. Lack of services to track trending coins. There is no doubt that the era of
information and communication technologies has created many golden opportunities
in several aspects. One of the fields that benefit from these technologies and online
connections is the financial and business sector. A growing number of online users has
activated virtual world concepts and created a new business phenomena. Thus, new
types of trading, transactions and currencies have been arising. Cryptocurrency is said
to be a weak form of commodity because investors are not able to predict the future
prospect because there is no available information from the past (Urquhart, 2016).
This is true since the inception of cryptocurrency has only emerged in 2009, nearly a
decade ago. There’s one more problem that is typical of cryptocurrency trackers i.e
Loss of a wallet file due to poor security systems.

Dr. AIT, Dept of 2021- 3


CryptoChart-Cryptocurrency

1.2 Proposed System


The proposed system includes all the information and support in one place. A hybrid
app with language support and a high-level design promotes easy access. One
application to track all the data related to

Dr. AIT, Dept of 2021- 4


CryptoChart-Cryptocurrency

the cryptocurrency of their choice. Traders can keep track of their cryptocurrency of
their choice, and for easier access they can add it to their accounts portfolio and keep
track of it easily.
Price prediction is a difficult challenge because several factors are to be taken into
consideration, based on these factors the price of a cryptocurrency is predicted
successfully. Traders may consider the predicted price for their future investment
plans. Price prediction may be done in a variety of ways. This review paper looked
into what has been done in the literature about the use of machine learning in
cryptocurrency price prediction.

1.2.1 Scope of the Work

Cryptocurrency price trackers should use reliable data and consistently update their
data. And by using correct machine learning algorithms and right datasets the future
value of the Coins can be predicted. This is done by using Machine Learning by using
LSTM Neural Networks. Machine learning has been successful in predicting stock
market prices through a host of different time series models, its application in
predicting cryptocurrency prices has been quite restrictive.
A Crypto currency price tracker monitors the current values of the digital currencies,
in addition to information about market capitalization, trading volume, price charts
and other types of data. The trackers accuracy can have a significant bearing on the
investors decisions, because of this, investors should choose their price tracker
carefully.
So, by using this application investors will know all the information they need prior
buying the cryptocurrencies like current price, market cap, older price comparisons
etc. by constantly updating the data.

1.2.2 Problem Statement

In last decade, cryptocurrency has emerged in financial area as a key factor in


businesses and financial market opportunities. Accurate predictions can assist

Dr. AIT, Dept of 2021- 5


CryptoChart-Cryptocurrency

cryptocurrency investors towards right investing decisions and lead to potential


increased profits. Additionally, they can also support policy makers and financial
researchers in studying cryptocurrency markets behaviour. Nevertheless,
cryptocurrency price prediction is considered a very challenging task, due to its
chaotic and very complex nature. In this we evaluated some of the most successful and
widely used deep learning algorithms forecasting cryptocurrency prices. The results
obtained, provide significant evidence that deep learning models are not able to solve
this problem efficiently and effectively. Conducting detailed experimentation and

Dr. AIT, Dept of 2021- 6


CryptoChart-Cryptocurrency

results analysis, we conclude that it is essential to invent and incorporate new


techniques, strategies and alternative approaches such as: more sophisticated
prediction algorithms, advanced ensemble methods, feature engineering techniques
and other validation metrics.

1.3 Objectives
This Application allows users to view Crypto currency prices and monitor their rise and
drop.

 User can Register and create an account.


 User can Login with the credentials used to sign up.
 User can View Lists of Crypto currencies with their prices.
 For the prices user can keep track of Hourly (1hr), Daily (24hr) & Weekly (7dy), Percentage
Drop or rise.
 A Crypto currency price tracker monitors the current values of the digital currencies, in
addition to information about market capitalization, trading volume, price charts and other
types of data.
 The trackers accuracy can have a significant bearing on the investors decisions, because of
this, investors should choose their price tracker carefully.
 Every coin also contains a section that displays the future predicted price based on the recent
data.

Dr. AIT, Dept of 2021- 7


CryptoChart-Cryptocurrency

CHAPTER 2

LITERATURE SURVEY

2.1 Abstract
The focus on cryptocurrencies in the finance and banking sectors is gaining
momentum. In this paper, we investigate the role of cryptocurrencies in modern
finance. We apply a narrative literature review method to synthesize prior research and
draw insights into the opportunities and challenges of leveraging cryptocurrencies.
The results indicate that cryptocurrencies offer businesses and individual’s lower
transaction costs, higher efficiencies, increased security and privacy, meaningful
diversion cation benefits, alternative financing solutions, and financial inclusion.
Challenges exist related to the integration of cryptocurrencies in modern finance.
These include the lack of regulatory standards, the risk of criminal activity, high
energy and environmental costs, regulatory bans and usage restrictions, security and
privacy concerns, and the high volatility of cryptocurrencies. The current review is
useful for scholars and managers, including those seeking to have a more balanced
understanding of these emerging financial instruments.

2.2 Introduction
Since the inception of the fiat money, people have been using it for everyday
transaction. Trading and transaction has been much easier. In the year 2009, after the
global crash of 2008, the first form of cryptocurrency has emerged in the form of
Bitcoin. It was first introduced by Nakamoto (2008), an anonymous group or
individual that has introduced Bitcoin as the first digital currency for easier day-to-day
transaction from individual to individual. Bitcoin is operated without the middle man
such as banks and monetary institutions. It is a form of peer-to-peer transaction,
without the need to reveal one’s identity for a transaction to happen. Unlike the current

Dr. AIT, Dept of 2021- 8


CryptoChart-Cryptocurrency

practice, the bank functions as the middleman or the go-between, knows the identity of
buyer and seller, thus engendering the issues of personal data protection. Bitcoin
platform has made the trading and transaction of cryptocurrency much easier and more
independent, without compromising personal information and details. To some, opting
for this method of transaction has entitled them to transact freely and anonymously.

Dr. AIT, Dept of 2021- 9


CryptoChart-Cryptocurrency

The instruments used as exchange instruments to make the trade transactions as easy
as possible according to the market needs have experienced a huge development and
change. Those instruments used to intermediate the exchange of goods are known as
money. Money as something that serves as a medium of exchange, a unit of
accounting, and a store of value. Money is a medium of exchange in the sense that we
all agree to accept it in making transactions. Merchants agree to accept money in
exchange for their goods; employees agree to accept money in exchange for their
labor. As a unit of accounting, money provides a simple device for identifying and
communicating value. Money serves as a store of value in that it allows us to store the
rewards of our labor or business in a convenient tool. According to Bohme et al
(2015), the basis of the bitcoin value is based on scarcity. It serves as the foundation to
put a value to any form of money. In the current practice of using the fiat currency, the
monetary authority or the central bank hold and reserve the money. Central bank of a
country has the power in adjusting the circulation of money and its absolute quantity.
The bank is able to produce only limited amount of these paper money for regulating
fiscal economic of a country, therefore creating scarcity. This scarcity will be recorded
in the bank bookkeeping and will be preserved by the legal rules.

The big question that arise as Bitcoin was introduced, are these cryptocurrencies
considered as real money? According to Ali et al. (2014), the history has outlined that
money must have the following criteria: (1) A store of value. It is a purchasing power
that users can manipulate to buy goods in the current time to the future. (2) A medium
of exchange. The ability to make payments and (3) A unit of account. The value that can
be measured of any goods for sale. Money theoretically must meet all these criteria but it
is not always the case. Analyzing Bitcoin and other cryptocurrency in their current form,
all the three criteria are debatable. One can postulate that it does have a store value due
to the ability for purchasing power, but due to uncertainty, one cannot estimate
whether Bitcoin can be used in the future as it is being used now. For medium of
exchange, some can justify that cryptocurrency can be used for a medium of exchange,
but to others the goods that can be exchanged are limited.

Dr. AIT, Dept of 2021- 10


CryptoChart-Cryptocurrency

If all these three criteria are set to be the pre-requirement for any commodity to be
given the stature of money, therefore it should be accepted within the context of its use
and application. Radford (1945) reported that cigarettes met all these criteria during the
hard time of World War 2 where prisoners in war camps used it for transaction. Further
back in time, cooking salt can be regarded as having value in the time of Roman Empire
where the troop’s wages were paid in salt. As for cryptocurrency, it can be regarded as
money to people who are computer and internet enabled. The problem lies on the fact
that only a small fraction of the people worldwide has the access to internet devices.
Therefore, within this context, similar to the prisoner in the war camp and the Roman
troops, cryptocurrency only is limited to those having access to the internet.

Dr. AIT, Dept of 2021- 11


CryptoChart-Cryptocurrency

Ali et al. (2014) reported that only about 20,000 Bitcoin holders in the United
Kingdom with only 300 transactions each day. This number would be even smaller in
emerging and developing countries due to the lack of internet access.
Bohme et al. (2015) suggested that cryptocurrency, particularly Bitcoin is more of a
platform for payment rather than currency due to its real time convertible to a
conventional currency in fixed value. This cryptocurrency is different from other assets
in term of its portfolio analysis, risk management and sentiment analysis (Dyhrberg,
2016). Compared to other assets such as gold, property, stocks and equity,
cryptocurrency does possess similar portfolio in term of having certain value.
Cryptocurrency however, resembles people’s sentiment as when the value elevates with
more and more people willing to accept them as payment. These differences create
various opportunities to the market where investors and stakeholders alike can benefit
from it. Therefore, to acknowledge cryptocurrency as the replacement for the fiat
money in today’s economics is still premature and requires further understanding in
application, theoretically and practically.

2.3 Objectives of the study


 To understand the concept of Cryptocurrencies and it’s functioning in regular trading.
 To study the advantages and drawbacks of Cryptocurrencies.
 To analyze the challenges and opportunities of Cryptocurrencies in India.

2.4 Research methodology


We have selected analytical research methodology for the study. This survey is based
on secondary data referring to various sources such as journals, newspaper articles,
websites and statutory reports.

Dr. AIT, Dept of 2021- 12


CryptoChart-Cryptocurrency

2.5 Cryptocurrency and how it works


“Cryptocurrency is an asset on a blockchain that can be exchanged or transferred
between network participants and hence used as a means of payment—but offers no
other benefits.” How cryptocurrency was initially gained or received? As to fiat
money, it is issued by the central bank, while cryptocurrency is created by mining via
the blockchain using cryptography technology. This is the method of issuing

Dr. AIT, Dept of 2021- 13


CryptoChart-Cryptocurrency

new cryptocurrency. The blockchain system consisting of users, developers, miners,


node maintainers and the interactions that ensure the functionality of the distributed
ledgers. Such mining process requires miners to have capital expenses in purchasing
the software and hardware. The software includes GUIMiner, BFGminer and
CGminer are the examples used in Bitcoin mining. While the hardware’s are
AntMiner, Avalon and ASICMiner. Mining of other currencies that uses many
different algorithms requires the use of high-end and high-speed graphic cards. For a
new miner, one needs to register a wallet and an encrypted banking online that can
store and accept the cryptocurrency. When a miner is able to solve the puzzle in the
blockchain system, the digital coins will be rewarded and transferred to the wallet that
has been predetermined earlier.

According to many of the cryptocurrency protocols, the way mining works is by


validating transaction by linking to the block that was accepted earlier. The blockchain
technology will record every transaction in its unit. A unique ID is assigned on each
block and the block preceding it. This is called the proof of work protocol. Proof of
work is a protocol of verifying a transaction and informing others about it. Users or
miners have to do work in validating or proofing that they are the real identities. These
works revolve around algorithm and puzzle that can be solved by computers
mathematical process. Proof of work adapted in cryptocurrency working principle is to
replace the centralized payment system imposed by the banking system. The main
basis of this system is to charge the user
i.e. the service requester in solving a problem that is considered to be hard to solve
compared to verifying it.

Miners would have to solve the puzzle embedded in the block, which contain the hash
of the previous block, the current block transaction hash and address that will be
rewarded after the puzzle is solved. This is the basic of the mining process. This in
turn created a block chain, a trace of the transaction that happened. This blockchain
technology will prevent any fraudsters to double spend of cryptocurrency by
tampering the transactions in the ledger.

Dr. AIT, Dept of 2021- 14


CryptoChart-Cryptocurrency

CHAPTER 3

SYSTEM REQUIREMENT
SPECIFICATIONS
Requirement analysis is a software engineering technique that is composed of the
various tasks that determine the needs or conditions that are to be met for a new or
altered product, taking into consideration that the possible conflicting requirement of
various users.

3.1 Hardware and Software Requirements


3.1.1 Software requirements

The software requirement specifies the pre-installed software needed to run the code
being implemented in this project.
 Operating system: Windows 10/MacOS
 Coding language: Java, Xml, Python,Kotlin
 IDE: Android Studio
 Additional software’s: Adobe Photoshop and Canva
 Storage: 50GB

3.1.2 Hardware requirements

The hardware requirement specifies the necessary hardware which provides us the
platform to implement our programs.

 Device: Any Android device

 Android version: 4.0.1 and above

 Storage: 100MB(min)

Dr. AIT, Dept of 2021- 15


CryptoChart-Cryptocurrency

3.2 Functional Requirements

Functional requirements are those requirements that are used to illustrate the internal
working nature of the system, the description of the system, and explanation of each
subsystem. It consists of what task the system should perform, the process involved,
which data should the system holds and the interfaces with the user. The functional
requirements identified are:

 The system must have register and account creation functionality.


 The system must have login functionality.
 The system must have the functionality to view lists of Crypto currencies with their prices.
 The system must have the functionality that can keep track of Hourly (1hr), Daily (24hr) &
Weekly (7dy), Percentage Drop or rise.
 The system must have the functionality to predict the future prices of coin.

3.3 Non-Functional Requirements

It describes aspects of the system that are concerned with how the system provide the
functional requirements they are:

 Security: Security is also the prime focus of this project. A username and password will be
required to log in to access the user interface. Authentication of user is done by verifying the
email address by sending the verification link to the user’s email.

 Error Handling: Should errors be encountered, an explanation will be displayed as to what


went wrong? An error will be defined as anything that falls outside the normal and intended
usage.

 Performance: Performance is going to be very important for this project. For everything to
run smoothly for this project, the REST APIs will have to be able to update data on
cryptocurrencies as frequently as possible. The REST APIs will also need to supply requested
data to the users at a reasonable speed. The database server will need to keep up with all
database requests and transactions.
Dr. AIT, Dept of 2021- 16
CryptoChart-Cryptocurrency

 Maintainability: Very little maintenance should be required for this setup. An initial
configuration will be the only system required interaction after system is put together. The
only other user maintenance would be any changes to settings after setup, and any specified
special cases where user settings or history need to be changed. Physical maintenance on the
system is not required since most of the services run on cloud platforms. Upgrades of
hardware and software should have little effect on this project, but may result in downtime.

Dr. AIT, Dept of 2021- 17


CryptoChart-Cryptocurrency

CHAPTER 4

SYSTEM DESIGN
Systems design is the process of defining elements of a system like modules,
architecture, components and their interfaces and data for a system based on the
specified requirements. Bottom-Up or Top- Down approach is required to take into
account all related variables of the system.
The system design of project is discussed in terms of pictorial representation. The flow
of project is analyzed and explained which helps in building the prototype. The
sequence and use case diagram understand the interaction of each modules.

4.1 Iterative model design


Iterative process starts with a simple implementation of a subset of the software
requirements and iteratively enhances the evolving versions until the full system is
implemented.
At each iteration, design modifications are made and new functional capabilities are
added. The basic idea behind this method is to develop a system through repeated
cycles iterative and in smaller portions at a time incremental.
Iterative and Incremental development is a combination of both iterative design or
iterative method and incremental build model for development. "During software
development, more than one iteration of the software development cycle may be in
progress at the same time." and "This process may be described as an "evolutionary
acquisition" or "incremental build" approach."
Following is a diagrammatic representation of different phases of waterfall model.

Dr. AIT, Dept of 2021- 18


CryptoChart-Cryptocurrency

Figure 4.1 Incremental model

Dr. AIT, Dept of 2021- 19


CryptoChart-Cryptocurrency

An iterative life cycle model does not attempt to start with a full specification of
requirements. Instead, development begins by specifying and implementing just part
of the software, which is then reviewed in order to identify further requirements. This
process is then repeated, producing a new version of the software at the end of each
iteration of the model.

In incremental model the whole requirement is divided into various builds. During
each iteration, the development module goes through the requirements, design,
implementation and testing phases. Each subsequent release of the module adds
function to the previous release. The process continues till the complete system is
ready as per the requirement.

The key to successful use of an iterative software development lifecycle is rigorous


validation of requirements, and verification & testing of each version of the software
against those requirements within each cycle of the model. As the software evolves
through successive cycles, tests have to be repeated and extended to verify each
version of the software.

4.2 App Development


The following technologies have been made use of:
 Java: Java is Object-Oriented. Java syntax is similar to C/C++. But Java does not provide
low-level programming functionalities like pointers. Also, Java code is always written in the
form of classes and objects. Android heavily relies on the Java programming language all
the SDKs required to build for android applications use the standard libraries of Java.
 Firebase: Google Firebase is a Google-backed application development software that enables
developers to develop iOS, Android and Web apps. Firebase provides tools for tracking
analytics, reporting and fixing app crashes, creating marketing and product experiment.
 Kotlin: Kotlin is an Object-oriented and functional programming are both supported by the
open-source, statically typed programming language Kotlin. Similar syntax and ideas from
several other languages, including C#, Java, and Scala, are available in Kotlin. Instead of
attempting to be original, Kotlin draws inspiration from decades of linguistic advancement.
There are versions of it that cater to native code (Kotlin/Native), JavaScript (Kotlin/JS), and
the JVM (Kotlin/JVM).

Dr. AIT, Dept of 2021- 20


CryptoChart-Cryptocurrency

 XML: Android layouts are written in eXtensible Markup Language, also known as XML.
Much like HTML (or HyperText Markup Language), XML is also a markup language. It was
created as a standard way to encode data in internet-based applications.

Dr. AIT, Dept of 2021- 21


CryptoChart-Cryptocurrency

However, unlike HTML, XML is case-sensitive, requires each tag is closed


properly, and preserves whitespace.

4.3 System Architecture

To put this project into action, we first needed to create an authentication system using
Firebase's authentication service. It is based on the email and the password method,
with password as an optional extra. It is efficient in monitoring the user's routing to
different pages depending upon if the user is logged in or not.

Figure 4.2 CryptoChart Android application Architecture diagram

After logging in, you will be prompted to the home page where you can view your
portfolio page. The top of the screen will contain a row where the top cryptocurrencies
will be displayed. You can freely search for your required product in the search bar,
which is located in the navigation bar. You can search from thousands of
cryptocurrencies available and the eye button at the top and be used to favourite the
cryptocurrency are to add it to your portfolio. Click on any Cryptocurrency you like
and then view the detailed description and then add it to the portfolio. You can view
the different cryptocurrencies that you have added to your portfolio in the main page
and then, if you want, you can remove the cryptocurrency you want.

Dr. AIT, Dept of 2021- 22


CryptoChart-Cryptocurrency

4.4 Flow Chart

Fig 4.3 Flow Chart


The flowchart shows the flow the entire system,
 User is allowed to register and login using their credentials once the registration is successful.

 If a user is not verified then an error will be raised.


 The flowchart shows sequence of execution of system.

Dr. AIT, Dept of 2021- 23


CryptoChart-Cryptocurrency

4.5 Class Diagram

Fig 4.4 Class Diagram


Class Diagram
 Analysis and design of the static view of an application.
 Describe responsibilities of a system.
 Base for component and deployment diagrams.
 Forward and reverse engineering

Dr. AIT, Dept of 2021- 24


CryptoChart-Cryptocurrency

Chapter 5

SYSTEM IMPLEMENTATION

5.1 Machine Learning

RNN: RNN’s are recurrent neural networks. Traditional neural networks can’t
remember previous sequences but RNN’s are capable of remembering previous
sequences. It gives output based on current as well as previous inputs. Recurrent
neural networks (RNN) are the state of the art algorithm for sequential data and are
used by Apple's Siri and Google's voice search. It is the first algorithm that remembers
its input, due to an internal memory, which makes it perfectly suited for machine
learning problems that involve sequential data. It is one of the algorithms behind the
scenes of the amazing achievements seen in deep learning over the past few years. In
this post, we'll cover the basic concepts of how recurrent neural networks work, what
the biggest issues are and how to solve them.

RNNs are a powerful and robust type of neural network, and belong to the most
promising algorithms in use because it is the only one with an internal memory.
Like many other deep learning algorithms, recurrent neural networks are relatively
old. They were initially created in the 1980’s, but only in recent years have we seen
their true potential. An increase in computational power along with the massive
amounts of data that we now have to work with, and the invention of long short-term
memory (LSTM) in the 1990s, has really brought RNNs to the foreground.
Because of their internal memory, RNN’s can remember important things about the
input they received, which allows them to be very precise in predicting what’s
coming next. This is why they're the preferred algorithm for sequential data like time
series, speech, text, financial data, audio, video, weather and much more. Recurrent
neural networks can form a much deeper understanding of a sequence and its context
compared to other algorithms.
Dr. AIT, Dept of 2021- 25
CryptoChart-Cryptocurrency

LSTM: LSTM is a variant of recurrent neural networks (RNN) which can store both
short and long- term data. They are the artificial recurrent neural networks used in the
field of deep learning. Long Short Term Memory is a kind of recurrent neural
network. In RNN output from the last step is fed as input in the current step. LSTM
was designed by Hochreiter & Schmidhuber. It tackled the problem of long-term
dependencies of RNN in which the RNN cannot predict the word stored in the

Dr. AIT, Dept of 2021- 26


CryptoChart-Cryptocurrency

long-term memory but can give more accurate predictions from the recent information.
As the gap length increases RNN does not give an efficient performance. LSTM can
by default retain the information for a long period of time. It is used for processing,
predicting, and classifying on the basis of time-series data.

Structure of LSTM
LSTM has a chain structure that contains four neural networks and different
memory blocks called cells.

Fig 5.1: Structure of LSTM

Information is retained by the cells and the memory manipulations are done by the
gates. There are three gates –

1. Forget Gate: The information that is no longer useful in the cell state is removed with the
forget gate. Two inputs x_t (input at the particular time) and h_t-1 (previous cell output) are
fed to the gate and multiplied with weight matrices followed by the addition of bias. The
resultant is passed through an activation function which gives a binary output. If for a
particular cell state the output is 0, the piece of information is forgotten and for output 1, the
information is retained for future use.

Dr. AIT, Dept of 2021- 27


CryptoChart-Cryptocurrency

Fig: 5.2 Forget Gate


2. Input gate: The addition of useful information to the cell state is done by the input gate.
First, the information is regulated using the sigmoid function and filter the values to be
remembered similar to the forget gate using inputs h_t-1 and x_t. Then, a vector is created
using tanh function that gives an output from -1 to +1, which contains all the possible values
from h_t-1 and x_t. At last, the values of the vector and the regulated values are multiplied
to obtain the useful information.

Fig 5.3 Input gate

3. Output gate: The task of extracting useful information from the current cell state to be
presented as output is done by the output gate. First, a vector is generated by applying tanh
function on the cell. Then, the information is regulated using the sigmoid function and filter
by the values to be remembered using inputs h_t-1 and x_t. At last, the values of the vector
and the regulated values are multiplied to be sent as an output and input to the next cell.

Dr. AIT, Dept of 2021- 28


CryptoChart-Cryptocurrency

Fig 5.4: Input Gate


We are predicting the cryptocurrency price by looking into the time series considering
long term data.Time series: It is a sequence of data points measured at a consistent
time interval.In ML, we are using LSTM neural networks as it can store long term data
and is capable of learning order dependence in sequence prediction problems.

LSTM consists of two states named:

 Cell state - for storing long term data.


 Hidden state – for storing short term data.

Fig 5.5: LSTM State Diagram

For dataset for price prediction we are using Yahoo Finance API. The dataset contains
following attributes.

Dr. AIT, Dept of 2021- 29


CryptoChart-Cryptocurrency

Fig 5.6: API data Obtained from Yahoo Finance API

Dataset is normalized using minmaxscaler for building the model. We are splitting the
data set into training set and testing set for training, testing and validating the model as
shown in the below diagram.
 Training data - 80%
 Testing data – 20%

After normalization closing price is extracted for prediction of cryptocurrency


price.We are using Tensor flow for building the model and Matplotlib for plotting the
graph. Optimizer used is adam for updating the weights.

The LSTM model is built and trained using the data and the predicted output is
produced by using test data.

Fig 5.7: Graph plotted between actual and predicted price using LSTM model

Dr. AIT, Dept of 2021- 30


CryptoChart-Cryptocurrency

Chapter
6 SYSTEM TESTING

6.1 Introduction
System Testing is a basic form of verification and validation performed on a
completely integrated system. Testing is not meant to replace other ways to ensuring
quality (like reviews). Itis one of the method to detect defects in the software product.
The purpose of testing is to uncover the defects in the system. Testing is done by the
group of people within the software product (organization) whose goal and charter is
to uncover the defects in the product before it reaches the customer.

The developer normally prepares a set of test cases that are planned to break the
system behavior that is developed. In engineering, normally testing process is seen as
a destructive process rather than constructive. Testing the application within the
stipulated time increases chances of the product to meet its requirements completely.
Testing requires asking about and understanding what you are trying to test, knowing
what the correct outcome is and why you are performing any test.

If we carry out tests without understanding why we are running them, we will end up
in running in appropriate tests that do not address what the product is intended to do.
We would like to assign a broader meaning to the term ‘customer’. IT does not mean
just external customers. Thereare also internal customers. IF a product is built using
different components from different groups within an organization, the users of these
different components should be considered as customers.

6.1.1 Verification

Verification normally contributes towards the quality assurance of the product, in


other words it includes the set of activities to focus on the question “Are we
constructing the product or the module right”? To build the product right, a set of
conditions/procedures should be maintained at the beginning of the life cycle. These

Dr. AIT, Dept of 2021- 31


CryptoChart-Cryptocurrency

activities are considered as “proactive”. As their purposeis to prevent the defects


before they take in shape.

The verification and quality assurance are one and the same. Requirement review,
design review and the code review are some examples of the verification activities.
The requirement specification might alone contain many fault portions which needs to
be detected in early stages, else the project or the module developed on this
specification will collapse.

Dr. AIT, Dept of 2021- 32


CryptoChart-Cryptocurrency

6.1.2 Validation

Validation involves the process to evaluate the system component at the end of the
development process and will checked against the software requirements so as to
know whether the business needs are met or not. Examples of validation process are
smoke testing, functional testing, regression testing, system testing etc.

package com.binarybricks.cryptochart.epoxymodels

import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.View
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.airbnb.epoxy.ModelProp
import com.airbnb.epoxy.ModelView
import com.android.volley.Request
import com.android.volley.RetryPolicy
import com.android.volley.VolleyError
import com.android.volley.toolbox.JsonObjectRequest
import com.android.volley.toolbox.Volley
import com.binarybricks.cryptochart.R
import com.binarybricks.cryptochart.data.PreferenceManager
import com.binarybricks.cryptochart.featurecomponents.ModuleItem
import com.binarybricks.cryptochart.network.models.CoinPrice
import com.binarybricks.cryptochart.utils.Formaters
import com.binarybricks.cryptochart.utils.resourcemanager.AndroidResourceManager
import
com.binarybricks.cryptochart.utils.resourcemanager.AndroidResourceManagerImpl
import kotlinx.android.synthetic.main.coin_statistic_module.view.*
import java.util.*

@ModelView(autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT)
class CoinStatsticsItemView @JvmOverloads constructor(
context: Context,
attributeSet: AttributeSet? = null,
defStyle: Int = 0,
) : ConstraintLayout(context, attributeSet, defStyle){

private val tvOpenAmount: TextView


private val predictionAmount: TextView
private val tvTodaysHighAmount: TextView
private val tvTodayLowAmount: TextView
private val tvChangeTodayAmount: TextView
private val tvVolumeQuantity: TextView
private val tvAvgVolumeAmount: TextView
private val tvAvgMarketCapAmount: TextView
private val tvSupplyNumber: TextView

private val currency: Currency by lazy {


Currency.getInstance(PreferenceManager.getDefaultCurrency(context))
}

val androidResourceManager: AndroidResourceManager by lazy {


AndroidResourceManagerImpl(context)

Dr. AIT, Dept of 2021- 33


CryptoChart-Cryptocurrency

private val formatter by lazy {


Formaters(androidResourceManager)
}

init {
View.inflate(context, R.layout.coin_statistic_module, this)
tvOpenAmount = findViewById(R.id.tvOpenAmount)
tvTodaysHighAmount = findViewById(R.id.tvTodaysHighAmount)
predictionAmount = findViewById(R.id.predictionAmount)
tvTodayLowAmount = findViewById(R.id.tvTodayLowAmount)
tvChangeTodayAmount = findViewById(R.id.tvChangeTodayAmount)
tvVolumeQuantity = findViewById(R.id.tvVolumeQuantity)
tvAvgVolumeAmount = findViewById(R.id.tvAvgVolumeAmount)
tvAvgMarketCapAmount = findViewById(R.id.tvAvgMarketCapAmount)
tvSupplyNumber = findViewById(R.id.tvSupplyNumber)
}

@ModelProp(options = [ModelProp.Option.IgnoreRequireHashCode])
fun setCoinPrice(coinStatisticsModuleData: CoinStatisticsModuleData) {
val coinPrice = coinStatisticsModuleData.coinPrice
tvOpenAmount.text = formatter.formatAmount(
coinPrice.openDay
?: "0",
currency, true
)
tvTodaysHighAmount.text = formatter.formatAmount(
coinPrice.highDay
?: "0",
currency, true
)
tvTodayLowAmount.text = formatter.formatAmount(
coinPrice.lowDay
?: "0",
currency, true
)
tvChangeTodayAmount.text = formatter.formatAmount(
coinPrice.changeDay
?: "0",
currency, true
)

tvVolumeQuantity.text = formatter.formatAmount(
coinPrice.volumneDay
?: "0",
currency, true
)
tvAvgVolumeAmount.text = formatter.formatAmount(
coinPrice.totalVolume24Hour
?: "0",
currency, true
)

tvAvgMarketCapAmount.text = formatter.formatAmount(
coinPrice.marketCap
?: "0",
currency, false
)

tvSupplyNumber.text = androidResourceManager.getString(
R.string.twoTextWithSpace,
formatter.formatNumber(coinPrice.supply ?: 0) ?: "",
coinPrice.fromSymbol ?: ""
)
Dr. AIT, Dept of 2021- 34
CryptoChart-Cryptocurrency

setprediction(CoinStatsticsItemView.CoinStatisticsModuleData(coinPrice))
}

fun setprediction(coinStatisticsModuleData: CoinStatisticsModuleData) {


val coinPrice = coinStatisticsModuleData.coinPrice
val URL = "http://cryptochart9293.pythonanywhere.com/?coin=$
{coinPrice.fromSymbol}"
val requestQueue = Volley.newRequestQueue(context)
val objectRequest = JsonObjectRequest(
Request.Method.GET, URL, null,
{ response ->
predictionAmount.text = formatter.formatAmount(
response.toString().substring(14,
response.toString().indexOf("}"))
?: "0",
currency, false
)
}
) { error -> Log.e("Rest Response", error.toString()) }
objectRequest.retryPolicy = object : RetryPolicy {
override fun getCurrentTimeout(): Int {
return 50000
}

override fun getCurrentRetryCount(): Int {


return 50000
}

@Throws(VolleyError::class)
override fun retry(error: VolleyError) {
}
}
requestQueue.add(objectRequest)
}

data class CoinStatisticsModuleData(val coinPrice: CoinPrice) : ModuleItem


}

 Add Coin Coding

package com.binarybricks.cryptochart.epoxymodels

import android.content.Context
import android.util.AttributeSet
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.airbnb.epoxy.CallbackProp
import com.airbnb.epoxy.ModelView
import com.binarybricks.cryptochart.R
import com.binarybricks.cryptochart.featurecomponents.ModuleItem

@ModelView(autoLayout = ModelView.Size.MATCH_WIDTH_WRAP_HEIGHT)
class AddCoinItemView @JvmOverloads constructor(
context: Context,
attributeSet: AttributeSet? = null,
defStyle: Int = 0,
) : ConstraintLayout(context, attributeSet, defStyle) {

private val addCoinCard: View

init {

Dr. AIT, Dept of 2021- 35


CryptoChart-Cryptocurrency

View.inflate(context, R.layout.dashboard_new_coin_module, this)


addCoinCard = findViewById(R.id.addCoinCard)
}

@CallbackProp
fun setAddCoinClickListener(listener: OnClickListener?) {
addCoinCard.setOnClickListener(listener)
}

object AddCoinModuleItem : ModuleItem


}

 COIN FRAMENT

package com.binarybricks.cryptochart.features.coin

import CoinContract
import CoinTickerContract
import CryptoNewsContract
import android.os.Bundle
import android.view.*
import androidx.fragment.app.Fragment
import com.binarybricks.cryptochart.CryptoChartApplication
import com.binarybricks.cryptochart.R
import com.binarybricks.cryptochart.data.PreferenceManager
import com.binarybricks.cryptochart.data.database.entities.CoinTransaction
import com.binarybricks.cryptochart.data.database.entities.WatchedCoin
import com.binarybricks.cryptochart.epoxymodels.*
import com.binarybricks.cryptochart.featurecomponents.ModuleItem
import
com.binarybricks.cryptochart.featurecomponents.cointickermodule.CoinTickerPresenter
import
com.binarybricks.cryptochart.featurecomponents.cointickermodule.CoinTickerRepositor
y
import
com.binarybricks.cryptochart.featurecomponents.cryptonewsmodule.CryptoNewsPresenter
import
com.binarybricks.cryptochart.featurecomponents.cryptonewsmodule.CryptoNewsRepositor
y
import
com.binarybricks.cryptochart.featurecomponents.historicalchartmodule.ChartRepositor
y
import com.binarybricks.cryptochart.features.CryptoCompareRepository
import com.binarybricks.cryptochart.features.coindetails.CoinDetailsActivity
import com.binarybricks.cryptochart.features.coindetails.CoinDetailsPagerActivity
import com.binarybricks.cryptochart.features.newslist.NewsListActivity
import com.binarybricks.cryptochart.features.ticker.CoinTickerActivity
import com.binarybricks.cryptochart.network.HOUR
import com.binarybricks.cryptochart.network.models.CoinPrice
import com.binarybricks.cryptochart.network.models.CryptoCompareHistoricalResponse
import com.binarybricks.cryptochart.network.models.CryptoPanicNews
import com.binarybricks.cryptochart.network.models.CryptoTicker
import com.binarybricks.cryptochart.utils.defaultExchange
import com.binarybricks.cryptochart.utils.dpToPx
import com.binarybricks.cryptochart.utils.resourcemanager.AndroidResourceManager
import
com.binarybricks.cryptochart.utils.resourcemanager.AndroidResourceManagerImpl
import com.binarybricks.cryptochart.utils.ui.OnVerticalScrollListener
import com.google.android.material.snackbar.Snackbar
import com.google.firebase.crashlytics.FirebaseCrashlytics
import kotlinx.android.synthetic.main.fragment_coin_details.*
import java.math.BigDecimal

class CoinFragment : Fragment(), CoinContract.View, CryptoNewsContract.View,


CoinTickerContract.View {

Dr. AIT, Dept of 2021- 36


CryptoChart-Cryptocurrency

private val coinDetailList: MutableList<ModuleItem> = mutableListOf()


private var coinPrice: CoinPrice? = null
private var watchedMenuItem: MenuItem? = null
private var isCoinWatched = false
private var isCoinedPurchased = false
private var watchedCoin: WatchedCoin? = null

private val coinRepo by lazy {


CryptoCompareRepository(CryptoChartApplication.database)
}

private val chartRepo by lazy {


ChartRepository()
}

private val coinPresenter: CoinPresenter by lazy {


CoinPresenter(coinRepo, chartRepo)
}

private val cryptoNewsRepository by lazy {


CryptoNewsRepository()
}
private val cryptoNewsPresenter: CryptoNewsPresenter by lazy {
CryptoNewsPresenter(cryptoNewsRepository)
}

private val coinTickerRepository by lazy {


CoinTickerRepository(CryptoChartApplication.database)
}
private val coinTickerPresenter: CoinTickerPresenter by lazy {
CoinTickerPresenter(coinTickerRepository, androidResourceManager)
}

private val androidResourceManager: AndroidResourceManager by lazy {


AndroidResourceManagerImpl(requireContext())
}

private val toCurrency: String by lazy {


PreferenceManager.getDefaultCurrency(context?.applicationContext)
}

companion object {
private const val WATCHED_COIN = "WATCHED_COIN"

@JvmStatic
fun getArgumentBundle(watchedCoin: WatchedCoin): Bundle {
val bundle = Bundle()
bundle.putParcelable(WATCHED_COIN, watchedCoin)
return bundle
}
}

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,


savedInstanceState: Bundle?): View? {
val inflate = inflater.inflate(R.layout.fragment_coin_details, container,
false)

watchedCoin = arguments?.getParcelable(WATCHED_COIN)

setHasOptionsMenu(true)

FirebaseCrashlytics.getInstance().log("CoinFragment")

return inflate
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {


Dr. AIT, Dept of 2021- 37
CryptoChart-Cryptocurrency

super.onViewCreated(view, savedInstanceState)
watchedCoin?.let {

coinPresenter.attachView(this)
cryptoNewsPresenter.attachView(this)
coinTickerPresenter.attachView(this)

lifecycle.addObserver(coinPresenter)
lifecycle.addObserver(cryptoNewsPresenter)
lifecycle.addObserver(coinTickerPresenter)

val toolBarDefaultElevation = dpToPx(context, 12) // default elevation


of toolbar

rvCoinDetails.addOnScrollListener(object : OnVerticalScrollListener() {
override fun onScrolled(offset: Int) {
super.onScrolled(offset)
(activity as?
CoinDetailsPagerActivity)?.supportActionBar?.elevation =
Math.min(toolBarDefaultElevation.toFloat(), offset.toFloat())
(activity as?
CoinDetailsActivity)?.supportActionBar?.elevation =
Math.min(toolBarDefaultElevation.toFloat(), offset.toFloat())
}
})

rvCoinDetails.setItemSpacingDp(8)

// load data
coinPresenter.loadCurrentCoinPrice(it, toCurrency)

if (it.purchaseQuantity > BigDecimal.ZERO) {


isCoinedPurchased = true
isCoinWatched = true
} else if (it.watched) {
isCoinWatched = true
}
}
}

override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {

inflater.inflate(R.menu.coin_details_menu, menu)

watchedMenuItem = menu.findItem(R.id.action_watch)

changeCoinMenu(isCoinWatched, isCoinedPurchased)
super.onCreateOptionsMenu(menu, inflater)
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {


when (item.itemId) {
R.id.action_watch -> {
isCoinWatched = !isCoinWatched
changeCoinMenu(isCoinWatched, isCoinedPurchased)
changeCoinWatchedStatus(isCoinWatched)
return true
}
}
return super.onOptionsItemSelected(item)
}

private fun changeCoinWatchedStatus(isCoinWatched: Boolean) {


watchedCoin?.let {
coinPresenter.updateCoinWatchedStatus(isCoinWatched, it.coin.id,
it.coin.symbol)

Dr. AIT, Dept of 2021- 38


CryptoChart-Cryptocurrency

(activity as? CoinDetailsPagerActivity)?.isCoinInfoChanged = true


}
}

private fun changeCoinMenu(isCoinWatched: Boolean, isCoinPurchased: Boolean) {


if (!isCoinPurchased) {
if (isCoinWatched) {
watchedMenuItem?.icon =
context?.getDrawable(R.drawable.ic_watching)
watchedMenuItem?.title =
context?.getString(R.string.remove_to_watchlist)
} else {
watchedMenuItem?.icon = context?.getDrawable(R.drawable.ic_watch)
watchedMenuItem?.title =
context?.getString(R.string.add_to_watchlist)
}
} else {
watchedMenuItem?.isVisible = false
}
}

override fun onCoinWatchedStatusUpdated(watched: Boolean, coinSymbol: String) {

val statusText = if (watched) {


getString(R.string.coin_added_to_watchlist, coinSymbol)
} else {
getString(R.string.coin_removed_to_watchlist, coinSymbol)
}

Snackbar.make(rvCoinDetails, statusText, Snackbar.LENGTH_LONG).show()


}

override fun showOrHideLoadingIndicator(showLoading: Boolean) {


// do nothing
}

override fun showOrHideLoadingIndicatorForTicker(showLoading: Boolean) {


// do nothing
}

override fun onNetworkError(errorMessage: String) {


Snackbar.make(rvCoinDetails, errorMessage, Snackbar.LENGTH_LONG).show()
}

override fun onCoinPriceLoaded(coinPrice: CoinPrice?, watchedCoin: WatchedCoin)


{

this.coinPrice = coinPrice

coinDetailList.add(CoinHistoricalChartItemView.HistoricalChartModuleData(coinPrice,
HOUR, watchedCoin.coin.symbol, null))

if (coinPrice != null) {

coinDetailList.add(CoinStatsticsItemView.CoinStatisticsModuleData(coinPrice))

coinDetailList.add(
CoinInfoItemView.CoinInfoModuleData(
coinPrice.market
?: defaultExchange,
watchedCoin.coin.algorithm, watchedCoin.coin.proofType
)
)
}

coinDetailList.add(CoinAboutItemView.AboutCoinModuleData(watchedCoin.coin))
Dr. AIT, Dept of 2021- 39
CryptoChart-Cryptocurrency

coinPresenter.loadHistoricalData(HOUR, watchedCoin.coin.symbol, toCurrency)

coinTickerPresenter.getCryptoTickers(watchedCoin.coin.coinName.toLowerCase())
cryptoNewsPresenter.getCryptoNews(watchedCoin.coin.symbol)
coinPresenter.loadRecentTransaction(watchedCoin.coin.symbol)

coinDetailList.add(GenericFooterItemView.FooterModuleData())

showCoinDataInView(coinDetailList)
}

override fun onHistoricalDataLoaded(period: String, historicalDataPair:


Pair<List<CryptoCompareHistoricalResponse.Data>,
CryptoCompareHistoricalResponse.Data?>) {
watchedCoin?.coin?.let {
coinDetailList[0] =
CoinHistoricalChartItemView.HistoricalChartModuleData(coinPrice, period, it.symbol,
historicalDataPair)
showCoinDataInView(coinDetailList)
}
}

private fun showCoinDataInView(detailList: List<ModuleItem>) {


rvCoinDetails.withModels {
detailList.forEachIndexed { index, moduleItem ->
when (moduleItem) {
is CoinHistoricalChartItemView.HistoricalChartModuleData ->
coinHistoricalChartItemView {
id("coinHistoricalChartItem")
chartData(moduleItem)
onChartRangeSelected(object :
CoinHistoricalChartItemView.OnHistoricalChardRangeSelectionListener {
override fun onRangeSelected(period: String,
fromCurrency: String, toCurrency: String) {
coinPresenter.loadHistoricalData(period,
fromCurrency, toCurrency)
}
})
}
is CoinInfoItemView.CoinInfoModuleData -> coinInfoItemView {
id("coinInfo")
exchange(moduleItem)
}
is CoinStatsticsItemView.CoinStatisticsModuleData ->
coinStatsticsItemView {
id("coinStats")
coinPrice(moduleItem)
}
is CoinTickerItemView.CoinTickerModuleData ->
coinTickerItemView {
id("coinTickerItem")
coinTickerData(moduleItem)
moreClickListener { _ ->
watchedCoin?.coin?.let {

startActivity(CoinTickerActivity.buildLaunchIntent(requireContext(), it.coinName))
}
}
}
is CoinNewsItemView.CoinNewsItemModuleData -> coinNewsItemView
{
id("coinNewsItem")
coinNews(moduleItem)
moreClickListener { _ ->
watchedCoin?.coin?.let {

Dr. AIT, Dept of 2021- 40


CryptoChart-Cryptocurrency

startActivity(NewsListActivity.buildLaunchIntent(requireContext(), it.coinName,
it.symbol))
}
}
}
is CoinAboutItemView.AboutCoinModuleData -> coinAboutItemView {
id("aboutCoin")
coin(moduleItem)
}

is GenericFooterItemView.FooterModuleData ->
genericFooterItemView {
id("footer")
footerContent(moduleItem)
}
}
}
}
}

override fun onNewsLoaded(cryptoPanicNews: CryptoPanicNews) {


val matchingIndex = coinDetailList.indexOfFirst { moduleItem ->
moduleItem is CoinAboutItemView.AboutCoinModuleData
}

if (matchingIndex > 0) {
coinDetailList.add(matchingIndex,
CoinNewsItemView.CoinNewsItemModuleData(cryptoPanicNews))
} else {

coinDetailList.add(CoinNewsItemView.CoinNewsItemModuleData(cryptoPanicNews))
}

showCoinDataInView(coinDetailList)
}

override fun onPriceTickersLoaded(tickerData: List<CryptoTicker>) {

val matchingIndex = coinDetailList.indexOfFirst { moduleItem ->


moduleItem is CoinInfoItemView.CoinInfoModuleData
}

if (matchingIndex > 0) {
coinDetailList.add(matchingIndex + 1,
CoinTickerItemView.CoinTickerModuleData(tickerData))
} else {
coinDetailList.add(CoinTickerItemView.CoinTickerModuleData(tickerData))
}

showCoinDataInView(coinDetailList)
}

override fun onRecentTransactionLoaded(coinTransactionList:


List<CoinTransaction>) {
if (coinTransactionList.isNotEmpty()) {
coinPrice?.let {
// add position module
}

// add transaction module


showCoinDataInView(coinDetailList)
}
}
}

Dr. AIT, Dept of 2021- 41


CryptoChart-Cryptocurrency

 MACHINE LEARNING : PYTHON CODE FOR PRICE


PREDUCTION
from flask import Flask, request
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
import datetime as dt
from pandas_datareader import data as web
from tensorflow.keras.models import load_model
import json

app = Flask(__name__)

@app.route('/')
def hello_world():

coin=str(request.args.get('coin'))
prediction_days = 60
scaler = MinMaxScaler(feature_range =(0,1))
crypto_currency = coin
against_currency = 'INR'
start = dt.datetime(2019,1,1)
end = dt.datetime.now()

data = web.DataReader(f'{crypto_currency}-{against_currency}','yahoo',start,end)

test_start = dt.datetime(2021,1,1)
test_end = dt.datetime.now()

test_data = web.DataReader(f'{crypto_currency}-{against_currency}','yahoo',test_start,test_end)

total_dataset = pd.concat((data['Close'], test_data['Close']), axis=0)

model_inputs = total_dataset[len(total_dataset) - len(test_data) - prediction_days:].values


model_inputs = model_inputs.reshape(-1,1)
model_inputs = scaler.fit_transform(model_inputs)

model=load_model('/home/Cryptochart9293/mysite/'+coin+'.h5')

real_data = [model_inputs[len(model_inputs) - prediction_days:len(model_inputs) + 1, 0]]


real_data = np.array(real_data)
real_data = np.reshape(real_data, (real_data.shape[0], real_data.shape[1], 1))

prediction = model.predict(real_data)
prediction = scaler.inverse_transform(prediction)
json_str = json.dumps({'prediction':float(prediction)})
return json_str

Dr. AIT, Dept of 2021- 42


CryptoChart-Cryptocurrency

6.2 Testing
Process
The Testing process comprises of reading the requirement documents and developing
the test cases which helps to test the product against the requirement which in turn
fulfills the business needs. Testing can be described as heart of software development
process. Testing is carried out ina way to certify that the product compiles with the
standards that is intended too. Normally requirement ID’s are associated to each of the
test case to track the coverage of all the requirements of the system.

6.3 Testing Plan


The Main purpose of planning is to have a approach to determine the scope of testing,
resources involved, time schedule required for the testing etc. A systemic approach is
followed to ensure all the safety standards or regulatory codes are inculcated in the
software. The plan normally encloses the detailed understanding of the workflow. It
also includes test coverage which is used to check whether all the requirements are
satisfied by the system under test throughout the life cycleof the product. It will have
plans for the risks which might arise in the product at later stages and a plan to
overcome the same will be addressed.
Normally testing life cycle constitutes different testing phases, the test coverage might
get overlapped at different stages depending on the testing model being used under the
project. The overlap might happen in the same stage/phase of testing. For example,
some requirements which were verified only during design verification test but not
repeated. The planning phase is applicable for both development and testing phases.
The methods used to build the tests will be determined by the standards, regulatory
agencies or based on agreements. The test method in the test plan includes the test
coverage implementation details and also it specifies test equipment or the test
environment that needs to be used to determinethe pass/fail criteria. Coverage also
applies to development phase where in statement coverage, branch coverage, path
coverage etc., are examined. When it comes to hardware test methods, it might include
Dr. AIT, Dept of 2021- 43
CryptoChart-Cryptocurrency

just a visual inspection or procedures which needs to be documented separately.

Dr. AIT, Dept of 2021- 44


CryptoChart-Cryptocurrency

A good test plan leads to deliver the product on time which leads to customer
satisfaction. The test organizations prepare the plan to acquire / develop test
equipment and other resources required to implement the test methods. The test
responsibilities include, collecting the pre- condition data, to know how the data will
be stored and reported. The outcome of successful test plan will be a record/report of
the verification of all the requirement specifications of the product/application under
test. This plan will be agreed upon by all parties (client and team).

6.4 Test strategy


It contains various strategies that will be followed to perform testing. It includes what
are the in scope and out of scope parts for the particular testing being carried out. The
environments which is involved in the testing and how the project is approaching in
terms of testing process.

6.4.1 Phases of Testing

There are different phases of testing involved in any of the testing process, each phase
of testing will focus on different aspects of the systems. The basic levels of testing
followed in industryare unit testing, integration testing, system and acceptance testing.

 Unit Testing: It is the primary phase of testing. Normally unit testing involves verification of
code developed by the developer during the coding phase. The coding should satisfy all the
standards such as syntax, logic, coverage etc. This type of testing is done by the programmer
or the developer of the module. It focuses on testing the smallest unit of the product designed.
Each individual modules or units will be tested against the specifications produced during
the design ofthe module. Once the testing is carried out on individual modules/units, then
integration of these small units will be done later. Since most of the times, unit testing
concentrates on coding part, it is also called as “coding and unit testing”. The unit testing
might be done concurrently or serially based on the model of the testing being used in the
project.

 Integration Testing: After the completion of unit testing of every single unit available in the
system, modules are integrated. After integration, there might be chances that unexpected
Dr. AIT, Dept of 2021- 45
CryptoChart-Cryptocurrency

behavior might be noticed at the interface level between any two sub systems. So, integration
testing focuses on module integration.

Dr. AIT, Dept of 2021- 46


CryptoChart-Cryptocurrency

 System Testing: It includes testing the entire system against the requirement document to see
if all the business needs are met or not. It usually includes both functional and nonfunctional
requirements of the system.

 Acceptance Testing: The testing that is normally carried out by the customers or the
representative of the customers. This will be either done at the customer site or at the
organization level itself. It mainly focuses on the external behaviour of the system.

6.5 Unit Testing


The success of any of the unit tests is determined by the critical characteristics
enclosed within the same unit. While performing the unit tests, both positive and
negative scenarios which indicates the inappropriate behaviours needs to be covered to
aggravate the coverage. There are many tools available in the market which automates
all the important unit tests like Junit, Selenium etc. Using automation for unit testing
will reduce most of the manual efforts and budget of the project is also saved. This
will be usually carried out by developer as it mainly focuses on the
codingimplementation. In case of unit testing of a program, a unit may signify the
functions or procedures section of the code. The mainly purpose of the unit testing is
to isolate the individual units from the system and to check whether individual parts
are behaving as expected. It is normally termed as white box testing as functional
requirements are not taken into consideration at that level of testing.

6.5.1 Benefits of Unit testing

 Since unit testing is carried out on simple units, we can test the software without waiting for
another unit, hence dependency on other modules does not come into picture.
 Once the modification is done for the unit code, it allows the developer to regress throughout
the code at later time to make sure that the module is working even after the changes
incorporation.
 It helps the developer to understand the functionality featured by every single unit of the
system.

Dr. AIT, Dept of 2021- 47


CryptoChart-Cryptocurrency

6.7 Unit Test Cases

Unit Test Case 1

Test Case ID Unit Test Case 1

Description Testing new user register with valid credentials

Input Valid E-mail address and Phone number

Expected Output Registration Successful

Actual Result Got the expected output

Passed (?) Passed


Table 1 Unit Test Case 1

Unit Test Case 2


Test Case ID Unit Test Case 2

Description Testing new user register with Invalid credentials

Input Invalid E-mail address and Phone number

Expected Output Authentication failed

Actual Result Got the expected output

Passed (?) Passed


Table 2 Unit Test Case 2

Unit Test Case 3


Test Case ID Unit Test Case 3

Description Testing user login with valid credentials

Input Valid E-mail address and Password


Expected Output Login Successful

Actual Result Got the expected output


Passed (?) Passed

Table 3 Unit Test Case 3

Dr. AIT, Dept of 2021- 48


CryptoChart-Cryptocurrency

Unit Test Case 4


Test Case ID Unit Test Case 4

Description Testing user login with Invalid credentials

Input Invalid E-mail address and Password

Expected Output Login Failed


Actual Result Got the expected output

Passed (?) Passed

Table 4 Unit Test Case 4

Unit Test Case 5


Test Case ID Unit Test Case 5

Description Able to search for desired currency using search option

Input Name of the currency


Expected Output Desired currency

Actual Result Got the expected output

Passed (?) Passed

Table 5 Unit Test Case 5

Unit Test Case 6


Test Case ID Unit Test Case 6

Description Able to add desired currency to watch list

Input Click on favorite symbol in currency page

Expected Output Currency added to watch list

Actual Result Got the expected output

Passed (?) Passed


Table 6 Unit Test Case 6

Dr. AIT, Dept of 2021- 49


CryptoChart-Cryptocurrency

Unit Test Case 7


Test Case ID Unit Test Case 7

Description Able to accurately show the currency details and statistics with graph

Input Click on any currency

Expected Output Accurate results of a currency with graph

Actual Result Got the expected output


Passed (?) Passed

Table 7 Unit Test Case 7

Unit Test Case 8


Test Case ID Unit Test Case 8

Description Able to redirect to respective markets to buy sell cryptocurrency

Input Click on any markets

Expected Output Redirected to respective markets

Actual Result Got the expected output

Passed (?) Passed


Table 8 Unit Test Case 8

Dr. AIT, Dept of 2021- 50


CryptoChart-Cryptocurrency

6.8 Integration Test Cases

Integration Test Case 1

Test Case ID Integration Test Case 1


Description Able to Predict the price of a currency with good accuracy

Input Test data

Expected Output Predicted price for next day

Actual Result Got the expected output

Passed (?) Passed


Table 9 Integration Test Case 1

Integration Test Case 1


Test Case ID Integration Test Case 2

Able to retrieve the predicted price for a currency from deployed model
Description
and display it in the application

Input Cryptocurrency

Expected Output Predicted price

Actual Result Got the expected output

Passed (?) Passed

Table 10 Integration Test Case 2

Dr. AIT, Dept of 2021- 51


CryptoChart-Cryptocurrency

Chapter 7

SNAPSHOTS AND RESULTS

Figure 1 Splash Screen

Figure 2 Sign Up Figure 3 Login

Dr. AIT, Dept of 2021- 52


CryptoChart-Cryptocurrency

Figure 4 Home Screen

Figure 5 Coin Statistics

Dr. AIT, Dept of 2021- 53


CryptoChart-Cryptocurrency

Figure 6 About Details Figure 7 Search screen

Figure 8 News Page Figure 9 Search Results

Dr. AIT, Dept of 2021- 54


CryptoChart-Cryptocurrency

CONCLUSION
A Crypto currency price tracker monitors the current values of the digital currencies,
in addition to information about market capitalization, trading volume, price charts
and other types of data. The trackers accuracy can have a significant bearing on the
investors decisions, because of this, investors should choose their price tracker
carefully. Cryptocurrency price trackers should use reliable data and consistently
update their data and by using correct machine learning algorithms and right datasets
the future value of the Coins can be predicted. This is done by using Machine
Learning by using LSTM Neural Networks. So, by using this application investors
will know all the information they need prior buying the cryptocurrencies like current
price, market cap, older price comparisons etc. by constantly updating the data.

The future of trading lies well with new emerging technologies that are able to benefit
mankind. Needless to say that, users and industry player can evaluate whether
cryptocurrency can benefit or harm them, in accordance with their objectives and
perspectives in owning it. The opportunities in cryptocurrency in term of its security of
its technology, low transaction cost and high investment return. For the challenges, the
discussion revolved around law and regulation, high energy consumption, possibility of
crash and bubble, and attacks on network. The improvement and future work on
system include improving the security protocol, working on proof of activity, using the
by-product of proof of work and applying the knowledge management system. Looking
at the positive outlook of the blockchain technology and the prospect of government in
regulating cryptocurrency, more in-depth studies on several aspects of cryptocurrency
should be done. From then, application in using cryptocurrency in the best of its ability
would be one of the most prominent discoveries in the 21st century.

Dr. AIT, Dept of 2021- 55


CryptoChart-Cryptocurrency

FUTURE ENHANCEMENT

It is undeniable that the emergence of cryptocurrency will play a significant role in the
world’s economic fabric. So, in future we would be making it all in one featured
application i.e it would be possible for the users to create their own secure portfolio
and a service to validate the coins would be added. Future research on reducing the
51% attack on the market place by adding blockchain's best algorithms. The security
protocol should be better and trust on the system would allow it to be the norm for
users in doing their daily transaction via the internet. CoinShares i.e Capital Markets
matches human capital with purpose-built infrastructure and systems to help
institutional counterparties meet their unique liquidity needs through a full suite of
trading, risk management, and hedging services would be available. Transaction
history helps in user identifying there capital stats and the transaction rates will help
him keep update of the marketcaps and other mandatory charges can be our future
works.

Dr. AIT, Dept of 2021- 56


CryptoChart-Cryptocurrency

REFERENCES
[1] FAUZI, M.A., PAIMAN, N. and OTHMAN, Z., 2020. Bitcoin and cryptocurrency:
Challenges, opportunities and future works. The Journal of Asian Finance,
Economics, and Business, 7(8), pp.695-704.
[2] DeVries, P.D., 2016. An analysis of cryptocurrency, bitcoin, and the future.
International Journal of Business Management and Commerce, 1(2), pp.1-9.
[3] Giudici, G., Milne, A. and Vinogradov, D., 2020. Cryptocurrencies: market analysis
and perspectives. Journal of Industrial and Business Economics, 47(1), pp.1-18.
[4] Bonneau, J., Miller, A., Clark, J., Narayanan, A., Kroll, J.A. and Felten, E.W., 2015,
May. Sok: Research perspectives and challenges for bitcoin and cryptocurrencies. In
2015 IEEE symposium on security and privacy (pp. 104-121). IEEE.
[5] Damsgaard, J., 2022. The Real Value of Cryptocurrency. Available at SSRN 4034312.
[6] Rejeb, A., Rejeb, K. and Keogh, J.G., 2021. Cryptocurrencies in Modern
Finance: A Literature Review. Etikonomi, 20(1), pp.93-118.
[7] Valdeolmillos, D., Mezquita, Y., González-Briones, A., Prieto, J. and Corchado, J.M.,
2019, June. Blockchain technology: a review of the current challenges of
cryptocurrency. In International Congress on Blockchain and Applications (pp. 153-
160). Springer, Cham.
[8] Jani, S., 2018. The growth of cryptocurrency in India: Its challenges & potential
impacts on legislation. Research gate publication.
[9] Marne, S., Correia, D., Churi, S. and Gomes, J., 2020. Predicting Price of
Cryptocurrency-A deep learning approach. NTASU-9 (3).
[10] Abraham, J., Higdon, D., Nelson, J. and Ibarra, J., 2018. Cryptocurrency
price prediction using tweet volumes and sentiment analysis. SMU Data
Science Review, 1(3), p.1.
[11] Tanwar, S., Patel, N.P., Patel, S.N., Patel, J.R., Sharma, G. and Davidson,
I.E., 2021. Deep learning-based cryptocurrency price prediction scheme
with inter-dependent relations. IEEE Access, 9, pp.138633-138646.
[12] Narayan, P.K., Narayan, S., Rahman, R.E. and Setiawan, I., 2019. Bitcoin
price growth and Indonesia's monetary system. Emerging Markets
Review, 38, pp.364-376

Dr. AIT, Dept of 2021- 57


CryptoChart-Cryptocurrency

[13] Lahmiri, S. and Bekiros, S., 2019. Cryptocurrency forecasting with deep learning
chaotic neural networks. Chaos, Solitons & Fractals, 118, pp.35-40.
[14] Mallqui, D.C. and Fernandes, R.A., 2019. Predicting the direction,
maximum, minimum and closing prices of daily Bitcoin exchange rate
using machine learning techniques. Applied Soft Computing, 75, pp.596-
606.

Dr. AIT, Dept of 2021- 58

You might also like