Data ¶
Defines the fundamental data types represented within the trading domain.
- class Bar ( BarType bar_type , Price open , Price high , Price low , Price close , Quantity volume , uint64_t ts_event , uint64_t ts_init , bool is_revision=False ) ¶
-
Bases:
Data
Represents an aggregated bar.
- Parameters :
-
-
bar_type ( BarType ) – The bar type for this bar.
-
open ( Price ) – The bars open price.
-
high ( Price ) – The bars high price.
-
low ( Price ) – The bars low price.
-
close ( Price ) – The bars close price.
-
volume ( Quantity ) – The bars volume.
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the data event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the data object was initialized.
-
is_revision ( bool , default False ) – If this bar is a revision of a previous bar with the same ts_event .
-
- Raises :
-
-
ValueError – If high is not >= low .
-
ValueError – If high is not >= close .
-
ValueError – If low is not <= close .
-
- bar_type ¶
-
Return the bar type of bar.
- Returns :
-
BarType
- close ¶
-
Return the close price of the bar.
- Returns :
-
Price
- static from_dict ( dict values ) Bar ¶
-
Return a bar parsed from the given values.
- Parameters :
-
values ( dict [ str , object ] ) – The values for initialization.
- Returns :
-
Bar
- classmethod fully_qualified_name ( type cls ) str ¶
-
Return the fully qualified name for the Data class.
- Returns :
-
str
References
- high ¶
-
Return the high price of the bar.
- Returns :
-
Price
- is_revision ¶
-
If this bar is a revision for a previous bar with the same ts_event .
- Returns :
-
bool
- is_single_price ( self ) bool ¶
-
If the OHLC are all equal to a single price.
- Returns :
-
bool
- low ¶
-
Return the low price of the bar.
- Returns :
-
Price
- open ¶
-
Return the open price of the bar.
- Returns :
-
Price
- static to_dict ( Bar obj ) ¶
-
Return a dictionary representation of this object.
- Returns :
-
dict[str, object]
- ts_event ¶
-
The UNIX timestamp (nanoseconds) when the data event occurred.
- Returns :
-
uint64_t
- ts_init ¶
-
The UNIX timestamp (nanoseconds) when the object was initialized.
- Returns :
-
uint64_t
- volume ¶
-
Return the volume of the bar.
- Returns :
-
Quantity
- class BarSpecification ( int step , BarAggregation aggregation , PriceType price_type ) ¶
-
Bases:
object
Represents a bar aggregation specification including a step, aggregation method/rule and price type.
- Parameters :
-
-
step ( int ) – The step for binning samples for bar aggregation (> 0).
-
aggregation ( BarAggregation ) – The type of bar aggregation.
-
price_type ( PriceType ) – The price type to use for aggregation.
-
- Raises :
-
ValueError – If step is not positive (> 0).
- aggregation ¶
-
Return the aggregation for the specification.
- Returns :
-
BarAggregation
- static check_information_aggregated ( BarAggregation aggregation ) ¶
-
Check the given aggregation is a type of information aggregation.
- Parameters :
-
aggregation ( BarAggregation ) – The aggregation type to check.
- Returns :
-
bool – True if information aggregated, else False.
- static check_threshold_aggregated ( BarAggregation aggregation ) ¶
-
Check the given aggregation is a type of threshold aggregation.
- Parameters :
-
aggregation ( BarAggregation ) – The aggregation type to check.
- Returns :
-
bool – True if threshold aggregated, else False.
- static check_time_aggregated ( BarAggregation aggregation ) ¶
-
Check the given aggregation is a type of time aggregation.
- Parameters :
-
aggregation ( BarAggregation ) – The aggregation type to check.
- Returns :
-
bool – True if time aggregated, else False.
- static from_str ( unicode value ) BarSpecification ¶
-
Return a bar specification parsed from the given string.
- Parameters :
-
value ( str ) – The bar specification string to parse.
Examples
String format example is ‘200-TICK-MID’.
- Returns :
-
BarSpecification
- Raises :
-
ValueError – If value is not a valid string.
- static from_timedelta ( timedelta duration , PriceType price_type ) BarSpecification ¶
-
Return a bar specification parsed from the given timedelta and price_type.
- Parameters :
-
-
duration ( timedelta ) – The bar specification timedelta to parse.
-
price_type ( PriceType ) – The bar specification price_type.
-
Examples
BarSpecification.from_timedelta(datetime.timedelta(minutes=5), PriceType.LAST).
- Returns :
-
BarSpecification
- Raises :
-
ValueError – If duration is not rounded step of aggregation.
- is_information_aggregated ( self ) bool ¶
-
Return a value indicating whether the aggregation method is information-driven.
-
TICK_RUNS
-
VOLUME_RUNS
-
VALUE_RUNS
- Returns :
-
bool
-
- is_threshold_aggregated ( self ) bool ¶
-
Return a value indicating whether the bar aggregation method is threshold-driven.
-
TICK
-
TICK_IMBALANCE
-
VOLUME
-
VOLUME_IMBALANCE
-
VALUE
-
VALUE_IMBALANCE
- Returns :
-
bool
-
- is_time_aggregated ( self ) bool ¶
-
Return a value indicating whether the aggregation method is time-driven.
-
SECOND
-
MINUTE
-
HOUR
-
DAY
-
WEEK
-
MONTH
- Returns :
-
bool
-
- price_type ¶
-
Return the price type for the specification.
- Returns :
-
PriceType
- step ¶
-
Return the step size for the specification.
- Returns :
-
int
- timedelta ¶
-
Return the timedelta for the specification.
- Returns :
-
timedelta
- Raises :
-
ValueError – If aggregation is not a time aggregation, or is``MONTH`` (which is ambiguous).
- class BarType ( InstrumentId instrument_id , BarSpecification bar_spec , AggregationSource aggregation_source=AggregationSource.EXTERNAL ) ¶
-
Bases:
object
Represents a bar type including the instrument ID, bar specification and aggregation source.
- Parameters :
-
-
instrument_id ( InstrumentId ) – The bar types instrument ID.
-
bar_spec ( BarSpecification ) – The bar types specification.
-
aggregation_source ( AggregationSource , default EXTERNAL ) – The bar type aggregation source. If
INTERNAL
the DataEngine will subscribe to the necessary ticks and aggregate bars accordingly. Else ifEXTERNAL
then bars will be subscribed to directly from the data publisher.
-
Notes
It is expected that all bar aggregation methods other than time will be internally aggregated.
- aggregation_source ¶
-
Return the aggregation source for the bar type.
- Returns :
-
AggregationSource
- static from_str ( unicode value ) BarType ¶
-
Return a bar type parsed from the given string.
- Parameters :
-
value ( str ) – The bar type string to parse.
- Returns :
-
BarType
- Raises :
-
ValueError – If value is not a valid string.
- instrument_id ¶
-
Return the instrument ID for the bar type.
- Returns :
-
InstrumentId
- is_externally_aggregated ( self ) bool ¶
-
Return a value indicating whether the bar aggregation source is
EXTERNAL
.- Returns :
-
bool
- is_internally_aggregated ( self ) bool ¶
-
Return a value indicating whether the bar aggregation source is
INTERNAL
.- Returns :
-
bool
- spec ¶
-
Return the specification for the bar type.
- Returns :
-
BarSpecification
- class BookOrder ( double price , double size , OrderSide side , unicode order_id=None ) ¶
-
Bases:
object
Represents an order in a book.
- Parameters :
-
-
price ( double ) – The order price.
-
size ( double ) – The order size.
-
side (OrderSide {
BUY
,SELL
}) – The order side. -
id ( str ) – The order ID.
-
- exposure ( self ) double ¶
-
Return the total exposure for this order (price * size).
- Returns :
-
double
- static from_dict ( dict values ) BookOrder ¶
-
Return an order from the given dict values.
- Parameters :
-
values ( dict [ str , object ] ) – The values for initialization.
- Returns :
-
BookOrder
- order_id ¶
-
The orders ID.
- Returns :
-
str
- price ¶
-
The orders price.
- Returns :
-
double
- side ¶
-
The orders side.
- Returns :
-
OrderSide
- signed_size ( self ) double ¶
-
Return the signed size of the order (negative for
SELL
).- Returns :
-
double
- size ¶
-
The orders size.
- Returns :
-
double
- static to_dict ( BookOrder obj ) ¶
-
Return a dictionary representation of this object.
- Returns :
-
dict[str, object]
- update_order_id ( self , unicode value ) void ¶
-
Update the orders ID.
- Parameters :
-
value ( str ) – The updated order ID.
- update_price ( self , double price ) void ¶
-
Update the orders price.
- Parameters :
-
price ( double ) – The updated price.
- update_size ( self , double size ) void ¶
-
Update the orders size.
- Parameters :
-
size ( double ) – The updated size.
- class OrderBookDelta ( InstrumentId instrument_id , BookAction action , BookOrder order , uint64_t ts_event , uint64_t ts_init , uint64_t sequence=0 ) ¶
-
Bases:
Data
Represents a single difference on an OrderBook .
- Parameters :
-
-
instrument_id ( InstrumentId ) – The instrument ID for the book.
-
action (BookAction {
ADD
,UPDATED
,DELETE
,CLEAR
}) – The order book delta action. -
order ( Order ) – The order to apply.
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the data event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the data object was initialized.
-
sequence ( uint64 , default 0 ) – The unique sequence number for the update. If default 0 then will increment the sequence .
-
- action ¶
-
The order book delta action {
ADD
,UPDATED
,DELETE
,CLEAR
}.- Returns :
-
BookAction
- static from_dict ( dict values ) OrderBookDelta ¶
-
Return an order book delta from the given dict values.
- Parameters :
-
values ( dict [ str , object ] ) – The values for initialization.
- Returns :
-
OrderBookDelta
- classmethod fully_qualified_name ( type cls ) str ¶
-
Return the fully qualified name for the Data class.
- Returns :
-
str
References
- instrument_id ¶
-
The instrument ID for the order book.
- Returns :
-
InstrumentId
- order ¶
-
The order to apply.
- Returns :
-
Order
- sequence ¶
-
The unique sequence number.
- Returns :
-
uint64
- static to_dict ( OrderBookDelta obj ) ¶
-
Return a dictionary representation of this object.
- Returns :
-
dict[str, object]
- ts_event ¶
-
The UNIX timestamp (nanoseconds) when the data event occurred.
- Returns :
-
uint64_t
- ts_init ¶
-
The UNIX timestamp (nanoseconds) when the object was initialized.
- Returns :
-
uint64_t
- class OrderBookDeltas ( InstrumentId instrument_id , list deltas , uint64_t ts_event , uint64_t ts_init , uint64_t sequence=0 ) ¶
-
Bases:
Data
Represents bulk OrderBookDelta updates for an OrderBook .
- Parameters :
-
-
instrument_id ( InstrumentId ) – The instrument ID for the book.
-
deltas ( list [ OrderBookDelta ] ) – The list of order book changes.
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the data event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the data object was initialized.
-
- deltas ¶
-
The order book deltas.
- Returns :
-
list[OrderBookDelta]
- static from_dict ( dict values ) OrderBookDeltas ¶
-
Return order book deltas from the given dict values.
- Parameters :
-
values ( dict [ str , object ] ) – The values for initialization.
- Returns :
-
OrderBookDeltas
- classmethod fully_qualified_name ( type cls ) str ¶
-
Return the fully qualified name for the Data class.
- Returns :
-
str
References
- instrument_id ¶
-
The instrument ID for the order book.
- Returns :
-
InstrumentId
- sequence ¶
-
The unique sequence number.
- Returns :
-
uint64
- static to_dict ( OrderBookDeltas obj ) ¶
-
Return a dictionary representation of this object.
- Returns :
-
dict[str, object]
- ts_event ¶
-
The UNIX timestamp (nanoseconds) when the data event occurred.
- Returns :
-
uint64_t
- ts_init ¶
-
The UNIX timestamp (nanoseconds) when the object was initialized.
- Returns :
-
uint64_t
- class OrderBookSnapshot ( InstrumentId instrument_id , list bids , list asks , uint64_t ts_event , uint64_t ts_init , uint64_t sequence=0 ) ¶
-
Bases:
Data
Represents a snapshot in time for an OrderBook .
- Parameters :
-
-
instrument_id ( InstrumentId ) – The instrument ID for the book.
-
bids ( list ) – The bids for the snapshot.
-
asks ( list ) – The asks for the snapshot.
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the data event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the data object was initialized.
-
sequence ( uint64 , default 0 ) – The unique sequence number for the update. If default 0 then will increment the sequence .
-
- asks ¶
-
The snapshot asks.
- Returns :
-
list
- bids ¶
-
The snapshot bids.
- Returns :
-
list
- static from_dict ( dict values ) OrderBookSnapshot ¶
-
Return an order book snapshot from the given dict values.
- Parameters :
-
values ( dict [ str , object ] ) – The values for initialization.
- Returns :
-
OrderBookSnapshot
- classmethod fully_qualified_name ( type cls ) str ¶
-
Return the fully qualified name for the Data class.
- Returns :
-
str
References
- instrument_id ¶
-
The instrument ID for the order book.
- Returns :
-
InstrumentId
- sequence ¶
-
The unique sequence number.
- Returns :
-
uint64
- static to_dict ( OrderBookSnapshot obj ) ¶
-
Return a dictionary representation of this object.
- Returns :
-
dict[str, object]
- ts_event ¶
-
The UNIX timestamp (nanoseconds) when the data event occurred.
- Returns :
-
uint64_t
- ts_init ¶
-
The UNIX timestamp (nanoseconds) when the object was initialized.
- Returns :
-
uint64_t
- class Bet ( price , Quantity quantity , OrderSide side ) ¶
-
Bases:
object
Represents a bet “order” or “trade” in price space (not probability).
- Parameters :
- Raises :
-
ValueError – If price is less than 1.0.
- cost ( self ) ¶
- exposure ( self ) ¶
- static from_dict ( dict values ) Bet ¶
-
Return a Bet parsed from the given values.
- Parameters :
-
values ( dict [ str , object ] ) – The values for initialization.
- Returns :
-
Bet
- liability ( self ) ¶
- lose_payoff ( self ) ¶
- stake ( self ) ¶
- static to_dict ( Bet obj ) ¶
-
Return a dictionary representation of this object.
- Returns :
-
dict[str, object]
- win_payoff ( self ) ¶
- class QuoteTick ( InstrumentId instrument_id , Price bid , Price ask , Quantity bid_size , Quantity ask_size , uint64_t ts_event , uint64_t ts_init ) ¶
-
Bases:
Data
Represents a single quote tick in a financial market.
Contains information about the best top of book bid and ask.
- Parameters :
-
-
instrument_id ( InstrumentId ) – The quotes instrument ID.
-
bid ( Price ) – The top of book bid price.
-
ask ( Price ) – The top of book ask price.
-
bid_size ( Quantity ) – The top of book bid size.
-
ask_size ( Quantity ) – The top of book ask size.
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the tick event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the data object was initialized.
-
- Raises :
-
-
ValueError – If bid.precision != ask.precision .
-
ValueError – If bid_size.precision != ask_size.precision .
-
- ask ¶
-
Return the top of book ask price.
- Returns :
-
Price
- ask_size ¶
-
Return the top of book ask size.
- Returns :
-
Quantity
- bid ¶
-
Return the top of book bid price.
- Returns :
-
Price
- bid_size ¶
-
Return the top of book bid size.
- Returns :
-
Quantity
- static capsule_from_list ( items ) ¶
- extract_price ( self , PriceType price_type ) Price ¶
-
Extract the price for the given price type.
- Parameters :
-
price_type ( PriceType ) – The price type to extract.
- Returns :
-
Price
- extract_volume ( self , PriceType price_type ) Quantity ¶
-
Extract the volume for the given price type.
- Parameters :
-
price_type ( PriceType ) – The price type to extract.
- Returns :
-
Quantity
- static from_dict ( dict values ) QuoteTick ¶
-
Return a quote tick parsed from the given values.
- Parameters :
-
values ( dict [ str , object ] ) – The values for initialization.
- Returns :
-
QuoteTick
- static from_raw ( InstrumentId instrument_id , int64_t raw_bid , int64_t raw_ask , uint8_t bid_price_prec , uint8_t ask_price_prec , uint64_t raw_bid_size , uint64_t raw_ask_size , uint8_t bid_size_prec , uint8_t ask_size_prec , uint64_t ts_event , uint64_t ts_init ) QuoteTick ¶
-
Return a quote tick from the given raw values.
- Parameters :
-
-
instrument_id ( InstrumentId ) – The quotes instrument ID.
-
raw_bid ( int64_t ) – The raw top of book bid price (as a scaled fixed precision integer).
-
raw_ask ( int64_t ) – The raw top of book ask price (as a scaled fixed precision integer).
-
bid_price_prec ( uint8_t ) – The bid price precision.
-
ask_price_prec ( uint8_t ) – The ask price precision.
-
raw_bid_size ( Quantity ) – The raw top of book bid size (as a scaled fixed precision integer).
-
raw_ask_size ( Quantity ) – The raw top of book ask size (as a scaled fixed precision integer).
-
bid_size_prec ( uint8_t ) – The bid size precision.
-
ask_size_prec ( uint8_t ) – The ask size precision.
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the tick event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the data object was initialized.
-
- Returns :
-
QuoteTick
- Raises :
-
-
ValueError – If bid_price_prec != ask_price_prec .
-
ValueError – If bid_size_prec != ask_size_prec .
-
- classmethod fully_qualified_name ( type cls ) str ¶
-
Return the fully qualified name for the Data class.
- Returns :
-
str
References
- instrument_id ¶
-
Return the tick instrument ID.
- Returns :
-
Price
- static to_dict ( QuoteTick obj ) ¶
-
Return a dictionary representation of this object.
- Returns :
-
dict[str, object]
- ts_event ¶
-
The UNIX timestamp (nanoseconds) when the data event occurred.
- Returns :
-
uint64_t
- ts_init ¶
-
The UNIX timestamp (nanoseconds) when the object was initialized.
- Returns :
-
uint64_t
- class TradeTick ( InstrumentId instrument_id , Price price , Quantity size , AggressorSide aggressor_side , TradeId trade_id , uint64_t ts_event , uint64_t ts_init ) ¶
-
Bases:
Data
Represents a single trade tick in a financial market.
Contains information about a single unique trade which matched buyer and seller counterparties.
- Parameters :
-
-
instrument_id ( InstrumentId ) – The trade instrument ID.
-
price ( Price ) – The traded price.
-
size ( Quantity ) – The traded size.
-
aggressor_side ( AggressorSide ) – The trade aggressor side.
-
trade_id ( TradeId ) – The trade match ID (assigned by the venue).
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the tick event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the data object was initialized.
-
- Raises :
-
ValueError – If trade_id is not a valid string.
- aggressor_side ¶
-
Return the ticks aggressor side.
- Returns :
-
AggressorSide
- static capsule_from_list ( items ) ¶
- static from_dict ( dict values ) TradeTick ¶
-
Return a trade tick from the given dict values.
- Parameters :
-
values ( dict [ str , object ] ) – The values for initialization.
- Returns :
-
TradeTick
- static from_raw ( InstrumentId instrument_id , int64_t raw_price , uint8_t price_prec , uint64_t raw_size , uint8_t size_prec , AggressorSide aggressor_side , TradeId trade_id , uint64_t ts_event , uint64_t ts_init ) TradeTick ¶
-
Return a trade tick from the given raw values.
- Parameters :
-
-
instrument_id ( InstrumentId ) – The trade instrument ID.
-
raw_price ( int64_t ) – The traded raw price (as a scaled fixed precision integer).
-
price_prec ( uint8_t ) – The traded price precision.
-
raw_size ( uint64_t ) – The traded raw size (as a scaled fixed precision integer).
-
size_prec ( uint8_t ) – The traded size precision.
-
aggressor_side ( AggressorSide ) – The trade aggressor side.
-
trade_id ( TradeId ) – The trade match ID (assigned by the venue).
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the tick event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the data object was initialized.
-
- Returns :
-
TradeTick
- classmethod fully_qualified_name ( type cls ) str ¶
-
Return the fully qualified name for the Data class.
- Returns :
-
str
References
- instrument_id ¶
-
Return the ticks instrument ID.
- Returns :
-
Price
- price ¶
-
Return the ticks price.
- Returns :
-
Price
- size ¶
-
Return the ticks size.
- Returns :
-
Quantity
- static to_dict ( TradeTick obj ) ¶
-
Return a dictionary representation of this object.
- Returns :
-
dict[str, object]
- trade_id ¶
-
Return the ticks trade match ID.
- Returns :
-
Price
- ts_event ¶
-
The UNIX timestamp (nanoseconds) when the data event occurred.
- Returns :
-
uint64_t
- ts_init ¶
-
The UNIX timestamp (nanoseconds) when the object was initialized.
- Returns :
-
uint64_t
- class Ticker ( InstrumentId instrument_id , uint64_t ts_event , uint64_t ts_init ) ¶
-
Bases:
Data
The base class for all tickers.
- Parameters :
-
-
instrument_id ( InstrumentId ) – The instrument ID.
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the ticker event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the object was initialized.
-
Warning
This class should not be used directly, but through a concrete subclass.
- static from_dict ( dict values ) Ticker ¶
-
Return a ticker from the given dict values.
- Parameters :
-
values ( dict [ str , object ] ) – The values for initialization.
- Returns :
-
Ticker
- classmethod fully_qualified_name ( type cls ) str ¶
-
Return the fully qualified name for the Data class.
- Returns :
-
str
References
- instrument_id ¶
-
The ticker instrument ID.
- Returns :
-
InstrumentId
- static to_dict ( Ticker obj ) ¶
-
Return a dictionary representation of this object.
- Returns :
-
dict[str, object]
- ts_event ¶
-
The UNIX timestamp (nanoseconds) when the data event occurred.
- Returns :
-
uint64_t
- ts_init ¶
-
The UNIX timestamp (nanoseconds) when the object was initialized.
- Returns :
-
uint64_t
- class InstrumentClose ( InstrumentId instrument_id , Price close_price , InstrumentCloseType close_type , uint64_t ts_event , uint64_t ts_init ) ¶
-
Bases:
Data
Represents an instrument close at a venue.
- Parameters :
-
-
instrument_id ( InstrumentId ) – The instrument ID.
-
close_price ( Price ) – The closing price for the instrument.
-
close_type ( InstrumentCloseType ) – The type of closing price.
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the close price event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the object was initialized.
-
- close_price ¶
-
The instrument close price.
- Returns :
-
Price
- close_type ¶
-
The instrument close type.
- Returns :
-
InstrumentCloseType
- static from_dict ( dict values ) InstrumentClose ¶
-
Return an instrument close price event from the given dict values.
- Parameters :
-
values ( dict [ str , object ] ) – The values for initialization.
- Returns :
-
InstrumentClose
- classmethod fully_qualified_name ( type cls ) str ¶
-
Return the fully qualified name for the Data class.
- Returns :
-
str
References
- instrument_id ¶
-
The event instrument ID.
- Returns :
-
InstrumentId
- static to_dict ( InstrumentClose obj ) ¶
-
Return a dictionary representation of this object.
- Returns :
-
dict[str, object]
- ts_event ¶
-
The UNIX timestamp (nanoseconds) when the data event occurred.
- Returns :
-
uint64_t
- ts_init ¶
-
The UNIX timestamp (nanoseconds) when the object was initialized.
- Returns :
-
uint64_t
- class InstrumentStatusUpdate ( InstrumentId instrument_id , MarketStatus status , uint64_t ts_event , uint64_t ts_init ) ¶
-
Bases:
StatusUpdate
Represents an event that indicates a change in an instrument status.
- Parameters :
-
-
instrument_id ( InstrumentId ) – The instrument ID.
-
status ( MarketStatus ) – The instrument market status.
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the status update event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the object was initialized.
-
- static from_dict ( dict values ) InstrumentStatusUpdate ¶
-
Return an instrument status update from the given dict values.
- Parameters :
-
values ( dict [ str , object ] ) – The values for initialization.
- Returns :
-
InstrumentStatusUpdate
- classmethod fully_qualified_name ( type cls ) str ¶
-
Return the fully qualified name for the Data class.
- Returns :
-
str
References
- instrument_id ¶
-
The instrument ID.
- Returns :
-
InstrumentId
- status ¶
-
The instrument market status.
- Returns :
-
MarketStatus
- static to_dict ( InstrumentStatusUpdate obj ) ¶
-
Return a dictionary representation of this object.
- Returns :
-
dict[str, object]
- ts_event ¶
-
The UNIX timestamp (nanoseconds) when the data event occurred.
- Returns :
-
uint64_t
- ts_init ¶
-
The UNIX timestamp (nanoseconds) when the object was initialized.
- Returns :
-
uint64_t
- class StatusUpdate ( uint64_t ts_event , uint64_t ts_init ) ¶
-
Bases:
Data
The base class for all status updates.
- Parameters :
-
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the status update event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the object was initialized.
-
Warning
This class should not be used directly, but through a concrete subclass.
- classmethod fully_qualified_name ( type cls ) str ¶
-
Return the fully qualified name for the Data class.
- Returns :
-
str
References
- ts_event ¶
-
The UNIX timestamp (nanoseconds) when the data event occurred.
- Returns :
-
uint64_t
- ts_init ¶
-
The UNIX timestamp (nanoseconds) when the object was initialized.
- Returns :
-
uint64_t
- class VenueStatusUpdate ( Venue venue , MarketStatus status , uint64_t ts_event , uint64_t ts_init ) ¶
-
Bases:
StatusUpdate
Represents an update that indicates a change in a Venue status.
- Parameters :
-
-
venue ( Venue ) – The venue ID.
-
status ( MarketStatus ) – The venue market status.
-
ts_event ( uint64_t ) – The UNIX timestamp (nanoseconds) when the status update event occurred.
-
ts_init ( uint64_t ) – The UNIX timestamp (nanoseconds) when the object was initialized.
-
- static from_dict ( dict values ) VenueStatusUpdate ¶
-
Return a venue status update from the given dict values.
- Parameters :
-
values ( dict [ str , object ] ) – The values for initialization.
- Returns :
-
VenueStatusUpdate
- classmethod fully_qualified_name ( type cls ) str ¶
-
Return the fully qualified name for the Data class.
- Returns :
-
str
References
- status ¶
-
The venue market status.
- Returns :
-
MarketStatus
- static to_dict ( VenueStatusUpdate obj ) ¶
-
Return a dictionary representation of this object.
- Returns :
-
dict[str, object]
- ts_event ¶
-
The UNIX timestamp (nanoseconds) when the data event occurred.
- Returns :
-
uint64_t
- ts_init ¶
-
The UNIX timestamp (nanoseconds) when the object was initialized.
- Returns :
-
uint64_t
- venue ¶
-
The venue.
- Returns :
-
Venue
- class DataType ( type type , dict metadata=None ) ¶
-
Bases:
object
Represents a data type including metadata.
- Parameters :
-
-
type ( type ) – The Data type of the data.
-
metadata ( dict ) – The data types metadata.
-
- Raises :
-
-
ValueError – If type is not a subclass of Data .
-
TypeError – If metadata contains a key or value which is not hashable.
-
Warning
This class may be used as a key in hash maps throughout the system, thus the key and value contents of metadata must themselves be hashable.
- metadata ¶
-
The data types metadata.
- Returns :
-
dict[str, object]
- topic ¶
-
The data types topic string.
- Returns :
-
str
- type ¶
-
The Data type of the data.
- Returns :
-
type
- class GenericData ( DataType data_type , Data data ) ¶
-
Bases:
Data
Provides a generic data wrapper which includes data type information.
- Parameters :
-
-
data_type ( DataType ) – The data type.
-
data ( Data ) – The data object to wrap.
-
- data ¶
-
The data.
- Returns :
-
Data
- data_type ¶
-
The data type.
- Returns :
-
DataType
- classmethod fully_qualified_name ( type cls ) str ¶
-
Return the fully qualified name for the Data class.
- Returns :
-
str
References
- ts_event ¶
-
The UNIX timestamp (nanoseconds) when the data event occurred.
- Returns :
-
uint64_t
- ts_init ¶
-
The UNIX timestamp (nanoseconds) when the object was initialized.
- Returns :
-
uint64_t