Learn R Programming

rCoinbase (version 1.0.0)

cb_bars: Get OHLCV Bars (short-term)

Description

Get OHLCV Bars (short-term)

Usage

cb_bars(product_id, start_time, end_time, bar_size)

Value

Get a data.frame with rates for a single product by product ID, grouped in buckets.

returns OHLCV for cryptocurrencies

Arguments

product_id

= The trading pair (e.g. 'BTC-USD').

start_time

= The UNIX timestamp indicating the start of the time interval.

end_time

= The UNIX timestamp indicating the end of the time interval.

bar_size

= The timeframe each candle represents. Examples: ONE_MINUTE, FIVE_MINUTE, FIFTEEN_MINUTE, THIRTY_MINUTE, ONE_HOUR, TWO_HOUR, SIX_HOUR, ONE_DAY

Examples

Run this code
if (FALSE) {
  cb_bars(product_id = "ETH-USD", start_time = Sys.time()-hours(1),
          end_time = Sys.time(), bar_size = 'FIVE_MINUTE')
}

Run the code above in your browser using DataLab