R: Query Liberator

Query Liberator for Time Range from a Dataset

query <— function(…)

The query function takes a list of arguments and streams data as a generator of Arrow Record Batches.

Argument

Description

Type

Example

symbols

The security trading symbol(s) you wish to query

string or list

symbols="AAPL"

name

The name of the dataset

string

name=" daily_bars"

as _of

The date in time that you wish the data to be. as_of defaults to now. This value can be any past date so that you can see the data as it was known on the “as of” date.

string

Format YYYY-MM-DD HH:MM:SS

(HH:MM:SS optional)

as_of="2019-09-15"

back_to

The date where the return dataset should begin. This is reading all the data “back to” the specified date.

string

Format YYYY-MM-DD HH:MM:SS

(HH:MM:SS optional)

as_of=“2019-07-15”

fields

An optional filter of field names. Note: mandatory fields will always be included

string

fields= “volume”

stats

Set to 'total' to get count per symbol as Json result

string

stats= “total”

crux_key

if querying for a Crux data set

string

crux_key= “<Your Key>”

compress

The data compression method on the wire. CloudQuant uses compression.

Boolean

compress=FALSE

json_xfer

Json transfer. This is usually False

Boolean. Always False

json_xfer=FALSE

debug_stream

Send log info to this ostream ptr

stderr()

debug_stream= stderr()

user

The user identifier (as assigned by CloudQuant)

string

user=“Your Username”

token

The user’s assigned token

string

token=“Your Token”

Example Query for Time Range

print(liberator::get_dataframe(liberator::query(symbols="APPL", name=" daily_bars", as_of="2019-09-15", back_to="2019-09-10")))

Query Liberator for Stats as JSON Result

Setting the “stats” argument to “total” will tell the query to return a json result containing the count per symbol.

Example Query for Stats

print(liberator::query(symblols="APPL", name="daily_bars", as_of="2019-09-15", back_to=“2019-09-10”, stats=“total”))