public class SpreadOrder extends OrderBase
Spread order is similar to a regular Order
, but it has a
spreadSymbol
property that contains the symbol
of the actual spread that is being represented by spread order object.
eventSymbol
property contains the underlying symbol
that was used in subscription.
Like regular orders, spread order events arrive from
multiple sources for the same market symbol and are distinguished by their
index
.
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.
SpreadOrder
event has the following properties:
eventSymbol
- underlying 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;
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;
spreadSymbol
- spread symbol of this event.
eventFlags
property.
See Event Flags section of OrderBase
class documentation for details.
IndexedEventModel
class handles all the snapshot and transaction logic and conveniently represents
a list current of events.
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 tradeSpreadOrder#<source-id>
,
where <source-id>
is up to 4 ASCII characters with a mnemonic for the source like "ISE".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 |
---|
SpreadOrder()
Creates new spread order with default values.
|
SpreadOrder(String eventSymbol)
Creates new order with the specified underlying event symbol.
|
Modifier and Type | Method and Description |
---|---|
String |
getSpreadSymbol()
Returns spread symbol of this event.
|
void |
setSpreadSymbol(String spreadSymbol)
Changes spread symbol of this event.
|
String |
toString()
Returns string representation of this spread 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 SpreadOrder()
public SpreadOrder(String eventSymbol)
eventSymbol
- underlying event symbol.Copyright © 2002–2023 Devexperts LLC. All rights reserved.