public class Order extends OrderBase
Scope
.
Scope of an order is available via scope
property.
Order events arrive from
multiple sources for the same market symbol and are distinguished by their
index
. Index is a unique per symbol identifier of the event.
It is unique across all the sources of depth information for the symbol.
The event with sizeAsDouble
either 0
or NaN
is a signal to remove previously received order for the corresponding index.
The method hasSize
is a convenient method to test for size presence.
Events from finer-grained Scope
of detail give more information and include events
from coarse-grained Scope
of detail. For a consistent representation of the market depth
to the end-user, order events must be filtered to remove coarse-grained events that
are superseded by the finer-grained events.
Order
event has the following properties:
eventSymbol
- symbol of this event;
source
- source of this event;
eventFlags
- transactional event flags;
index
- unique per-symbol index of this order;
time
- time of this order;
timeNanoPart
- microseconds and nanoseconds time part of this order;
sequence
- sequence of this order;
price
- price of this order;
size
- size of this order as integer number (rounded toward zero);
sizeAsDouble
- size of this order as floating number with fractions;
OrderBase.getExecutedSize()
- executed size of this order;
count
- number of individual orders in this aggregate order;
exchangeCode
- exchange code of this order;
orderSide
- side of this order;
scope
- scope of this order;
marketMaker
- market maker or other aggregate identifier of this order.
eventFlags
property.
See Event Flags section of OrderBase
class documentation for details.
The composite quotes with Scope.COMPOSITE
and regional quotes with Scope.REGIONAL
come
individually from different venues and are not related to each other in any transactional way. The result of
getEventFlags
method for them is always zero.
OrderBookModel
class contains all the appropriate logic to deal with transactions and snapshots
for Order
events. The client-visible changes to the model are reported only when the snapshot for the
specific source id is received completely and when there is no ongoing transaction for the specific source id.
It relies on the code of AbstractIndexedEventModel
to handle this logic.
Use the source code of AbstractIndexedEventModel
for clarification on transactions and snapshot logic.
DXPublisher.publishEvents
method, least significant 32 bits of order index
must be in a range of from 0 to
Integer.MAX_VALUE
inclusive.
Use setSource
method after setIndex
to properly
include source identifier into the index.
A snapshot has to be published in the descending order of index
, starting with
an event with the largest index and marking it with IndexedEvent.SNAPSHOT_BEGIN
bit in eventFlags
,
and finishing the snapshot with an event that has zero 32 least significant bits of index.
IndexedEvent.SNAPSHOT_END
bit in eventFlags
is optional during publishing.
It will be properly set on receiving end anyway.
DXFeed.getLastEvent
method.
action
- event business meaning (see OrderAction
for more details)actionTime
- time of the last actionorderId
- ID of this orderauxOrderId
- additional ID for this ordertradeId
- trade (order execution) IDtradePrice
- price of the tradetradeSize
- size of the tradeQuote
for composite quotes with Scope.COMPOSITE
,
record Quote&X
for regional exchange best quotes with Scope.REGIONAL
,
record MarketMaker
for market-maker quotes and futures price level aggregates with Scope.AGGREGATE
,
record Order
for the most fine-grained Scope.ORDER
with zero source id,
and records Order#<source-id>
for specific source ids,
where <source-id>
is up to 4 ASCII characters with a mnemonic for the source like "NTV".LEVEL_AGGREGATE, LEVEL_COMPOSITE, LEVEL_ORDER, LEVEL_REGIONAL, MAX_SEQUENCE, SIDE_BUY, SIDE_SELL
REMOVE_EVENT, SNAPSHOT_BEGIN, SNAPSHOT_END, SNAPSHOT_MODE, SNAPSHOT_SNIP, TX_PENDING
Constructor and Description |
---|
Order()
Creates new order with default values.
|
Order(String eventSymbol)
Creates new order with the specified event symbol.
|
Modifier and Type | Method and Description |
---|---|
String |
getMarketMaker()
Returns market maker or other aggregate identifier of this order.
|
void |
setMarketMaker(String marketMaker)
Changes market maker or other aggregate identifier of this order.
|
String |
toString()
Returns string representation of this order event.
|
getAction, getActionTime, getAuxOrderId, getCount, getEventFlags, getExchangeCode, getExecutedSize, getIndex, getLevel, getOrderId, getOrderSide, getPrice, getScope, getSequence, getSide, getSize, getSizeAsDouble, getSource, getTime, getTimeNanoPart, getTimeNanos, getTimeSequence, getTradeId, getTradePrice, getTradeSize, hasSize, setAction, setActionTime, setAuxOrderId, setCount, setEventFlags, setExchangeCode, setExecutedSize, setIndex, setLevel, setOrderId, setOrderSide, setPrice, setScope, setSequence, setSide, setSize, setSizeAsDouble, setSource, setTime, setTimeNanoPart, setTimeNanos, setTimeSequence, setTradeId, setTradePrice, setTradeSize
getEventSymbol, getEventTime, setEventSymbol, setEventTime
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEventSymbol, getEventTime, setEventSymbol, setEventTime
public Order()
public Order(String eventSymbol)
eventSymbol
- event symbol.public String getMarketMaker()
Scope.AGGREGATE
and Scope.ORDER
orders.public void setMarketMaker(String marketMaker)
marketMaker
- market maker or other aggregate identifier of this order.Copyright © 2002–2023 Devexperts LLC. All rights reserved.