markets {cryptowatchR} | R Documentation |
Get prices of cryptocurrencies
Description
Get data.frame with prices of cryptocurrencies using the REST API of cryptowat.ch.
Usage
markets(pair, params = NULL, exchange = "kraken", route = "ohlc", datetime = TRUE)
Arguments
pair |
A string containing a pair symbol, e.g. btcusd (required argument). |
params |
A list containing |
exchange |
A character string containing the exchange. Default is kraken. |
route |
A character string containing the route. Default is ohlc. |
datetime |
A logical. |
Value
A data.frame containing OHLC candlestick prices of a given pair of currencies.
References
See https://docs.cryptowat.ch/rest-api for further information.
See Also
get_markets
, get_assets
, get_exchanges
, get_pairs
Examples
## Not run:
df.ohlc.hourly <- markets("btcusd")
df.ohlc.hourly2 <- markets("btcusd", list(periods = 3600, before = 1609851600,
after = 1609506000), datetime = FALSE)
df.ohlc.daily <- markets("btceur", list(periods = 86400, before = "2021-05-12",
after = "2021-01-01"), datetime = TRUE)
## End(Not run)
[Package cryptowatchR version 0.2.0 Index]