C#: Query Liberator for Time Range from a Dataset

public dynamic query(Dictionary<string, dynamic> dict);

The query function takes a Dictionary of arguments and streams data as a generator of Arrow Record Batches.  
The generator function pointer returned from the query should be used in a for each statement to generate Record Batches until the end of stream.

Argument

Description

Type

Example

symbols

The security trading symbol(s) you wish to query

String, or List<string>

{“symbols”,std::vector<std::string>{"AAPL","GOOGL"}}

name

The name of the dataset

String

{"name","daily_bars"}

as _of

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

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)

{"back_to","2019-07-15"}

fields

An optional filter of field names. You cannot remove mandatory fields

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

System.IO.TextWriter

{“debug_stream”, Console.Error}

warning_stream

Send warning info to this stream

System.IO.TextWriter

{“warning_stream”, Console.Error}

record_limit

Limit number of records

Int

{“record_limit”, 5}

user

The user identifier (as assigned by CloudQuant)

String

{“user”,”myUserID”}

token

The user’s assigned token

String

{“token”,”mypersonal-private-token”}

Example Query for Time Range

Liberator liberator;
var res = liberator.query(new Dictionary<string, dynamic>() {
                    {"name","daily_bars" },
                    {"as_of","2021-04-10" },
                    { "back_to","2021-03-10"},
                    { "symbols","ES"}
                    });

  foreach (RecordBatch batch in res())
  {
             var df = DataFrame.FromArrowRecordBatch(batch);
           Console.WriteLine(DateTime.Now.ToString("hh:mm:ss.fff") + “ " + DataFrameUtils.PrettyPrint(df));
  }