bittrex: An R client for the Bittrex Crypto-Currency Exchange
Authors: Michael J. Kane
License: LGPL-2
This software is in no way affiliated, endorsed, or approved by the Bittrex crypto-currency exchange or any of its affiliates. It comes with absolutely no warranty and should not be used in actual trading unless the user can read and understand the source and know what you are doing.
Package 'bittrex' is an R implementation of the REST interface used by the Bittrex crypto-currency exchange. It provides functions for endpoints supported by the exchange. This includes the ability to retrieve price, volume, and order book information as well as the ability to trade crypto-currencies.
Calls to the exchange are categorized as either public, which includes requests for price, volume, and order book information, and private, which includes all requests requiring an account including placing buy or sell orders. Public calls can be used directly by installing the package. Private calls require that you create an account and create an API and secret key with appropriate permissions.
Private calls retrieve the API and secret key using the BITTREX_API_KEY and BITTREX_SECRET_KEY environment variables. These may be set by the user before opening the R session or, they can be set using the 'bittrex_authenticate' function.
The package is available from GitHub and will be uploaded to CRAN shortly. If you wish to install the development version then install the devtools package, available from CRAN.
#install.packages("devtools")
devtools::install_github("ropensci/bittrex")
After installation, you may query the exchange with any of the public calls. For example, if we want to see the spread of the cost of doge coins in bitcoins, we can use the following code.
library(bittrex)
library(scales)
library(ggplot2)
# The price of doge coins in bitcoins.
doge_btc = bt_getmarkethistory(market='btc-doge')$result
ggplot(doge_btc, aes(x=time_stamp, y=price, group=order_type,
color=order_type)) + geom_line() +
scale_x_datetime(breaks=date_breaks("hours"),
labels=date_format("%m-%d %H:%M")) + xlab("Date and Time") +
ylab("Price") + scale_colour_discrete(name="Order Type")
If you would like to contribute to the project please contact the maintainer directly. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.