The map variant of tn_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.

tn_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.

Examples

if (FALSE) { # Get all trade data between 2019-05-03 12:00:00 and 2019-05-03 12:15:00 tn_map_trades( start_date = "2019-05-03 12:00:00", end_date = "2019-05-03 12:15:00", symbol = "XBTUSD" ) }