Ethereum: How to get Cryptocurrency Candlestick Market Data from Binance in R?

Here is an article on how to get a market for a candle with a cryptocurrency from Binance R:

Ethereum: How to obtain market data with candlesticks cryptocurrencies from Binan R

As an enthusiast cryptocurrency and trader, access to reliable and accurate market data, it is very important to make deliberate investment decision -making. In this article, we will study how to obtain a market for market with a candle cryptocurrency from Binance using the popular programming language R.

Installing the necessary libraries

Be sure to install the necessary libraries before immersing the code:

`r

Install.packages (“Readr”)

Install.packages (“JONITLITE”)

Install.packages (“BS4”)

html pages

`

Download data from Binance

To download data from Binance, we will use the Readr Library “Read_csv () function. First, go to the Binance API target that provides cryptocurrency market data:

`

`

We will use the goal “Get /Ticker /Price” with the “Symbol” parameter that interests us (eg Ethereum Ethereum).

`r

Library (Readr)

Binance_data <- Read_csv ("

`

This downloads data in CSV format. Note that you may need to adjust the “symbol” parameter according to the Binance API parameter and your special cryptocurrency.

Acquisition of candle data

Ethereum: How to get Cryptocurrency Candlestick Market Data from Binance in R?

We will use the “JesonliteLibrary" Read_json () library to analyze JSON's answer to get the candlestick market data.

r

Library (Jsonlite)

Candestick_data <- JONITLITE :: Fromjson (binance_data $ price) %> %

GROUP_BY (TICKER) %> %

Summarize (start = first (date), end = last (date), open = first (open), close = last (close))

`

This code gets the date, start and end of the time, the price of each opening and closing the candle prices.

Data pre -process

We may want pre -sales data before you continue your further analysis or visualization. Here is an example:

`r

Library (DHLYR)

Candestick_data <- Candestick_data %> %

mutate (date = date (as.date (date)), open = iFelse (open == on, 0, open), closed = iFelse (close == on, 0, closed))

`

This code adds the “Date” column to the data with the original date and sets the “Open” and “Cloos” column to 0 (shows the missing value).

Visualization

We can use the GGPLOT2 library to visualize the data.

r

Library (ggplot2)

ggplot (Candestick_data, AES (x = time stamp, y = price)) +

Geom_line (AES (Color = Ticker))

`

This code creates a row chart with a color that indicates a cryptocurrency.

Example of using

Here is an example of how you can use this code to analyze Ethereum’s market data:

`r

Library (Moninetals)

Binance_data <- Read_csv ("

Candestick_data <- JONITLITE :: Fromjson (binance_data $ price) %> %

GROUP_BY (TICKER) %> %

Summarize (start = first (date), end = last (date), open = first (open), close = last (close))

ggplot (Candestick_data, AES (x = Date, Y = Price))

Geom_line (AES (Color = Ticker))

`

In this example, we use the Coinmetals library to obtain market data on coins and visualize them through GGPLOT2.

Conclusion

Obtaining CryptoCurrency Candlestick from Binance R is a simple process using popular libraries such as “Readr”, “Jonallite” and “GGPLOT2”. With this code, you can analyze the market trends, identify potential business opportunities and make more informed investment decisions.


Reacties

Geef een reactie

Je e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *