Cryptocurrencies
With the surge in interest in digital assets, accurate transaction data have been in high demand recently. We have paired our efforts with CryptoCompare to offer our users the most reliable pricing and volume information from the cryptomarkets. Our AI engine supports:
- 30 the most popular cryptourrencies from CryptoCompare can be accessed through tables:
- CRYPTO-CC-USD (denominated in US dollar),
- CRYPTO-CC-EUR (denominated in euro),
- CRYPTO-CC-JPY (denominated in Japanese yen),
- CRYPTO-CC-GBP (denominated in pound sterling).
Let's quickly jump into an example how to access them in your crypto projects.
1. Package installation and setup
Firstly, make sure you have the most recent version of the API, available at github, and setup up you access rights.
install.packages("remotes") #just in case
remotes::install_github("rejustify/r-package")
library(rejustify)
setCurl(learn = TRUE) #to support the AI engine
register(token = "YOUR_TOKEN", email = "YOUR_EMAIL")
2. Design your data canvas
Secondly, design your data structure. In the example below, we will rejustify trading data for Bitcoin during the last 30 trading days. In particular, we're interested in open, high, low and close prices quoted in euros (check table structure), to appear in separate columns in the data table.
df <- data.frame(days = format(seq(from = Sys.time(), length.out = 30, by = "-1 day"), "%Y-%m-%d"),
`BTC,open` = NA,
`BTC,high` = NA,
`BTC,low` = NA,
`BTC,close` = NA,
check.names = FALSE, stringsAsFactors = FALSE)
Verify that the algorithm point to the correct resource. If you allow the algorithm to learn, you will do it only once - the next time the rejustify engine will recognize it automatically.
st <- analyze(df)
st <- adjust(st, column = 2:5, items = list('class' = 'general', feature = NA, 'provider' = 'REJUSTIFY', 'table' = 'CRYPTO-CC-EUR'))
3. Rejustify
Thirdly, rejustify.
rdf <- fill(df, st)
Original data set
days BTC,open BTC,high BTC,low BTC,close
2020-04-09 NA NA NA NA
2020-04-08 NA NA NA NA
2020-04-07 NA NA NA NA
2020-04-06 NA NA NA NA
2020-04-05 NA NA NA NA
2020-04-04 NA NA NA NA
2020-04-03 NA NA NA NA
2020-04-02 NA NA NA NA
2020-04-01 NA NA NA NA
2020-03-31 NA NA NA NA
2020-03-30 NA NA NA NA
2020-03-29 NA NA NA NA
2020-03-28 NA NA NA NA
2020-03-27 NA NA NA NA
2020-03-26 NA NA NA NA
2020-03-25 NA NA NA NA
2020-03-24 NA NA NA NA
2020-03-23 NA NA NA NA
2020-03-22 NA NA NA NA
2020-03-21 NA NA NA NA
2020-03-20 NA NA NA NA
2020-03-19 NA NA NA NA
2020-03-18 NA NA NA NA
2020-03-17 NA NA NA NA
2020-03-16 NA NA NA NA
2020-03-15 NA NA NA NA
2020-03-14 NA NA NA NA
2020-03-13 NA NA NA NA
2020-03-12 NA NA NA NA
2020-03-11 NA NA NA NA
Rejustified data set
days BTC,open BTC,high BTC,low BTC,close
2020-04-09 6786.17 6790.05 6576.93 6669.62
2020-04-08 6612.12 6830 6578.93 6786.17
2020-04-07 6802.53 6907.26 6502.57 6612.12
2020-04-06 6284.71 6807.77 6276.01 6802.53
2020-04-05 6365.96 6400.32 6208.36 6284.71
2020-04-04 6247.59 6474.55 6186.67 6365.96
2020-04-03 6263.16 6525.98 6141.02 6247.59
2020-04-02 6079.31 6616.62 6016.31 6263.16
2020-04-01 5837.51 6116.45 5651.07 6079.31
2020-03-31 5808.58 6073.96 5802.23 5837.51
2020-03-30 5286.76 5990.19 5276.15 5808.58
2020-03-29 5628.07 5649.25 5284.17 5286.76
2020-03-28 5746.34 5746.34 5431.51 5628.07
2020-03-27 6130.11 6227.87 5689.52 5746.34
2020-03-26 6161.12 6243.63 5981.79 6130.11
2020-03-25 6275.88 6458.3 6019.53 6161.12
2020-03-24 6048.65 6345.44 5938.4 6275.88
2020-03-23 5469.69 6158.81 5362.71 6048.65
2020-03-22 5819.09 6016.89 5405.4 5469.69
2020-03-21 5820.01 6066.65 5513.42 5819.09
2020-03-20 5826.88 6491.33 5378.35 5820.01
2020-03-19 4951.87 6042.05 4846.1 5826.88
2020-03-18 4876.52 4982.49 4613.32 4951.87
2020-03-17 4524.16 5074.38 4438.43 4876.52
2020-03-16 4821.97 4840.27 4026.27 4524.16
2020-03-15 4688.17 5360.85 4628.06 4821.97
2020-03-14 5112.94 5133.98 4580.39 4688.17
2020-03-13 4408.63 5421.44 3546.67 5112.94
2020-03-12 7050.05 7074.05 4236 4408.63
2020-03-11 6977.07 7092.1 6736.86 7050.05
The data table can be quickly represented as candle sticks using the DescTools, or any other graphical, package.
library(DescTools)
PlotCandlestick(x = as.Date( rdf$data$days ), y = data.matrix( rdf$data[,2:5] ), border = NA, ylab = "EUR")
More functionality of the API is described in our R package documentation. The full list of our resources, including data providers and tables, can be found in our repository browser.