The cryptoQuotes
-package is a high-level API-client to get current, and historical, cryptocurrency OHLC-V market and sentiment data in R
, without using web-crawlers or API keys. This R
-package uses xts
and zoo
under the hood and are compatible with quantmod
and TTR
out of the box.
All supported exchanges and markets are listed in the table below, alongside the available range of intervals available from the respective exchanges,
Exchange | Spot | Futures | Available Intervals | Smallest Interval | Biggest Interval |
---|---|---|---|---|---|
Binance | ✔ | ✔ | 16 | 1 second(s) | 1 month(s) |
Bitmart | ✔ | ✔ | 13 | 1 minute(s) | 1 week(s) |
Bybit | ✔ | ✔ | 13 | 1 minute(s) | 1 month(s) |
Kraken | ✔ | ✔ | 10 | 1 minute(s) | 2 week(s) |
Kucoin | ✔ | ✔ | 13 | 1 minute(s) | 1 week(s) |
Get USDT denominated Bitcoin spot market price from Binance with 30m
-intervals using the get_quote()
-function,
## BTC OHLC prices
## from Binance spot market
## in 30 minute intervals
BTC <- cryptoQuotes::get_quote(
ticker = 'BTCUSDT',
source = 'binance',
futures = FALSE,
interval = '30m',
from = Sys.Date() - 1
)
Index | open | high | low | close | volume |
---|---|---|---|---|---|
2024-03-12 10:30:00 | 71978.46 | 72085.06 | 71850.01 | 71936 | 818.1898 |
2024-03-12 11:00:00 | 71936 | 71959.12 | 71647.14 | 71705.63 | 587.18566 |
2024-03-12 11:30:00 | 71705.63 | 71999 | 71705.62 | 71864 | 642.93822 |
2024-03-12 12:00:00 | 71864 | 72376 | 71860 | 72062.98 | 1368.19948 |
2024-03-12 12:30:00 | 72062.99 | 72257.56 | 72012.72 | 72023.82 | 673.04693 |
2024-03-12 13:00:00 | 72023.82 | 72144.14 | 71576 | 71628.53 | 1283.8762 |
The BTC
-object can be charted using the chart()
-function,
## Chart BTC
## using klines, SMA,
## MACD and Bollinger Bands
cryptoQuotes::chart(
ticker = BTC,
main = cryptoQuotes::kline(),
sub = list(
cryptoQuotes::volume(),
cryptoQuotes::macd()
),
indicator = list(
cryptoQuotes::sma(n = 7),
cryptoQuotes::sma(n = 14),
cryptoQuotes::sma(n = 21),
cryptoQuotes::bollinger_bands()
)
)
# install from github
devtools::install_github(
repo = 'https://github.com/serkor1/cryptoQuotes/',
ref = 'development'
)
This library
is still considered experimental
but no breaking changes will be made on functions labelled as stable
without appropriate action; please refer to the release notes, or submit an issue if that promise is broken.
Please note that the cryptoQuotes
project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.