Time-Series

The time-series objects are keyed by

  • exchange

  • symbol

  • data_source (enum for the events generating the bars)

  • interval (enum for the sampling frequency)

  • origin (see following discussing about local and external)

The time-series objects are updated with roq::TimeSeriesUpdate and the samples are defined by roq::Bar.

Bars

The bars contain statistics the each sampling period and is keyed by the begin_time_utc.

Exchanges will often publish the most recent bar while it is in progress. The field named confirmed indicates if the bar is in progress (has the value false) or is historical (hast the value true).

Warning

Not all exchanges will publish the bar when it has been confirmed.

Local

Note

The origin field has the value GATEWAY.

Previously generated event-logs can be used to populate time-series objects upon gateway restart. For these time-series objects, the time-stamps are local to the gateway.

Important

This kind of time-series is generated by the gateway and is 100% CORRELATED with the receive_time_utc from live event types such as roq::TradeSummary.

You want to use this kind of time-series if your model must be initialized exactly from the history that was previously received by the same model.

In other words, you want the model output to be reproducable.

The gateway flags used to enable this feature can be found here.

External

Note

The origin field has the value EXCHANGE.

When supported by the exchange and the gateway, time-series objects can be dowloaded and subscribed from external data sources.

Important

The bars are received from an external data source and IS OFTEN DELAYED when compared to other live event types such as roq::TradeSummary.

You want to use this kind of time-series if you want to model some kind of on-exchange behaviour.

You can NOT rely on your model generating the same output between different runs.

The reasons are

  • Time-series data may be “cleaned” by the exchange.

  • We may experience network or downtime issues causing the model to not receive exchange data.

Please consult specific gateway flags to see if this feature can be enabled.