Skip to contents

Free of charge. Mirrors metadata.get_record_count, and the cheapest way to learn that a slice is empty before paying for it.

Usage

db_get_record_count(
  dataset,
  start,
  end = NULL,
  symbols = NULL,
  schema = "trades",
  stype_in = "raw_symbol",
  limit = NULL
)

Arguments

dataset

Dataset code, e.g. "GLBX.MDP3".

start, end

Request window, start inclusive and end exclusive. A string passes through verbatim, a Date becomes a plain date, a POSIXct an ISO-8601 UTC instant, and a number is read as nanoseconds since the UNIX epoch. Leaving end as NULL asks the server to forward-fill from start.

symbols

Character vector of symbols, a single comma-separated string, or NULL for all symbols. With stype_in = "instrument_id" a numeric vector is accepted. At most 2000 symbols per request.

schema

Schema name, see db_schemas().

stype_in

Symbol type of symbols, see db_stypes(). Use "parent" for product-level symbols such as "ES.FUT" or "SPX.OPT".

limit

Optional cap on the number of records.

Value

A single number: the record count.

Examples

if (FALSE) { # \dontrun{
db_get_record_count("GLBX.MDP3", start = "2024-01-01", end = "2024-02-01",
                    symbols = "ES.FUT", schema = "ohlcv-1d",
                    stype_in = "parent")
} # }