Order Latency Models

class ConstantLatency(entry_latency, response_latency)

Provides constant order latency. The units of the arguments should match the timestamp units of your data.

Parameters:
  • entry_latency (float64) – Order entry latency.

  • response_latency (float64) – Order response latency.

class FeedLatency(entry_latency_mul=1, resp_latency_mul=1, entry_latency=0, response_latency=0)

Provides order latency based on feed latency. The units of the arguments should match the timestamp units of your data.

Order latency is computed as follows:

  • feed_latency is calculated as the average latency between the latest feed’s latency and the subsequent feed’s latency(by forward-looking).

  • If either of these values is unavailable, the available value is used as the sole feed latency.

entry_latency = feed_latency * entry_latency_mul + entry_latency
response_latency = feed_latency * resp_latency_mul + response_latency
Parameters:
  • entry_latency_mul (float64) – Multiplier for feed latency to compute order entry latency.

  • resp_latency_mul (float64) – Multiplier for feed latency to compute order response latency.

  • entry_latency (float64) – Offset for order entry latency.

  • response_latency (float64) – Offset for order response latency.

class ForwardFeedLatency(entry_latency_mul=1, resp_latency_mul=1, entry_latency=0, response_latency=0)

Provides order latency based on feed latency. The units of the arguments should match the timestamp units of your data.

Order latency is computed as follows:

  • the subsequent feed’s latency(by forward-looking) is used as the feed latency.

entry_latency = feed_latency * entry_latency_mul + entry_latency
response_latency = feed_latency * resp_latency_mul + response_latency
Parameters:
  • entry_latency_mul (float64) – Multiplier for feed latency to compute order entry latency.

  • resp_latency_mul (float64) – Multiplier for feed latency to compute order response latency.

  • entry_latency (float64) – Offset for order entry latency.

  • response_latency (float64) – Offset for order response latency.

class BackwardFeedLatency(entry_latency_mul=1, resp_latency_mul=1, entry_latency=0, response_latency=0)

Provides order latency based on feed latency. The units of the arguments should match the timestamp units of your data.

Order latency is computed as follows:

  • the latest feed’s latency is used as the feed latency.

entry_latency = feed_latency * entry_latency_mul + entry_latency
response_latency = feed_latency * resp_latency_mul + response_latency
Parameters:
  • entry_latency_mul (float64) – Multiplier for feed latency to compute order entry latency.

  • resp_latency_mul (float64) – Multiplier for feed latency to compute order response latency.

  • entry_latency (float64) – Offset for order entry latency.

  • response_latency (float64) – Offset for order response latency.

class IntpOrderLatency(data)

Provides order latency by interpolating the actual historical order latency. This model provides the most accurate results. The units of the historical latency data should match the timestamp units of your feed data.

Parameters:

data (array) – An (n, 3) array consisting of three columns: local timestamp when the request was made, exchange timestamp, and local timestamp when the response was received.