map_trades {bitmexr}R Documentation

Trade data over an extended period

Description

The map variant of trades() uses a repeat loop to continually request trade data between two time points. The function will stop when the start_date is greater than end_date. Given the large number of trades executed per day, a warning message with a choice to continue is presented when inputting a date range spanning more than one day.

Usage

map_trades(
  symbol = "XBTUSD",
  start_date = "2019-01-01 12:00:00",
  end_date = "2019-01-01 12:15:00",
  filter = NULL,
  use_auth = FALSE,
  verbose = FALSE
)

Arguments

symbol

a character string for the instrument symbol. Use available_symbols() to see available symbols.

start_date

character string. Starting date for results in the format "yyyy-mm-dd" or "yyyy-mm-dd hh-mm-ss".

end_date

character string. Ending date for results in the format "yyyy-mm-dd" or "yyyy-mm-dd hh-mm-ss".

filter

an optional character string for table filtering. Send JSON key/value pairs, such as "{'key':'value'}". See examples in trades().

use_auth

logical. Use TRUE to enable authentication with API key.

verbose

logical. If TRUE, will print information to the console. Useful for long running requests.

Details

Warning! Due to the extremely large number of trades executed on the exchange, using this function over an extended of time frame will result in an extremely long running process. For example, during 2019 the exchange averaged approximately 630000 trades per day, with a maximum of 2114878 trades being executed in a single day. Obtaining the trade data for this day alone would take over an hour, and the use of map_bucket_trades() with a small 'binSize' (e.g., "1m") is preferrable.

Value

map_trades() returns a data.frame containing:

References

https://www.bitmex.com/api/explorer/#!/Trade/Trade_get

Examples

## Not run: 

# Get all trade data between 2019-05-03 12:00:00 and 2019-05-03 12:15:00

map_trades(
  start_date = "2019-05-03 12:00:00",
  end_date = "2019-05-03 12:15:00",
  symbol = "XBTUSD"
)

## End(Not run)


[Package bitmexr version 0.3.1 Index]