Learn R Programming

cryptoQuotes: A streamlined access to OHLC-V market data and sentiment indicators in R

:information_source: Overview

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.

Supported exchanges and markets

All supported exchanges and markets are listed in the table below, alongside the available range of intervals available from the respective exchanges,

:information_source: Basic Usage

OHLC-V Market Data

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 
)

Charting OHLC-V

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()
  )
)

:information_source: Installation

Stable version

# install from CRAN
install.packages(
  pkgs = 'cryptoQuotes',
  dependencies = TRUE
)

Development version

# install from github
devtools::install_github(
  repo = 'https://github.com/serkor1/cryptoQuotes/',
  ref  = 'development'
)

:warning: Disclaimer

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.

:information_source: Code of Conduct

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.

Copy Link

Version

Install

install.packages('cryptoQuotes')

Monthly Downloads

835

Version

1.3.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Serkan Korkmaz

Last Published

March 12th, 2024

Functions in cryptoQuotes (1.3.0)

FGIndex

Fear and Greed Index Values
availableTickers

Get available cryptocurrency pairs
calibrate_window

calibrate the time window of a list of xts objects
available_exchanges

Get available exchanges
available_tickers

Get available cryptocurrency pairs
bollinger_bands

Add Bollinger Bands to the chart
available_intervals

Get available intervals
default_dates

Get the minimum and maximum date range
cryptoQuotes-package

cryptoQuotes: A Streamlined Access to Cryptocurrency OHLC-V Market Data and Sentiment Indicators
chart

Build interactive financial charts
evwma

Add Elastic Volume-weighted Moving Average to the chart
fgi

Chart the Fear and Greed Index
getQuote

Get the Open, High, Low, Close and Volume data on a cryptocurrency pair
convert_date

Convert dates passed to UNIX
getFGIndex

Get the daily Fear and Greed Index for the cryptocurrency market
getLSRatio

Get the long to short ratio of a cryptocurrency pair
flatten

flatten nested lists
fetch

Fetch time-based API-endpoint responses
get_fgindex

Get the daily Fear and Greed Index for the cryptocurrency market
dema

Add Double Exponential Moving Average to the chart
get_openinterest

Get the open interest on perpetual futures contracts
get_quote

Get the Open, High, Low, Close and Volume data on a cryptocurrency pair
hma

Add Hull Moving Average to the chart
kline

Candlestick chart
ema

Add Exponentially Weighted Moving Average to the charts
is.date

Check if values are valid dates
lsr

Chart the long-short ratios
macd

Add MACD indicators to the chart
ohlc

OHLC chart
get_fundingrate

Get the funding rate on futures contracts
get_lsratio

Get the long to short ratio of a cryptocurrency pair
wma

Add Weighted Moving Average to the chart
zlema

Add Zero Lag Exponential Moving Average to the chart
remove_bound

remove upper and lower bounds from an XTS object
volume

Add volume indicators to the chart
rsi

Add RSI indicators to your chart
vwap

Add Volume-weighted Moving Average to the chart
sma

Add Simple Moving Averages to the charts
split_window

split xts object iteratively in lists of desired intervals
GET

GET-requests
assert

Assert truthfulness of conditions before evaluation
availableIntervals

Get available intervals
alma

Add Arnaud Legoux Moving Average to the chart
availableExchanges

Get available exchanges
add_event

add eventlines to the chart
ATOM

USDT denominated ATOMS with 15m intervals
BTC

USDT denominated Bitcoin(BTC) with 1 week intervals
DOGE

USDT denominated DOGECOIN in 1m intervals