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 size
of 0
is a signal to remove
previously received order for the corresponding index.
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;
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.
SpreadOrder#<source-id>
,
where <source-id>
is up to 3 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.
|
getCount, getEventFlags, getExchangeCode, getIndex, getLevel, getOrderSide, getPrice, getScope, getSequence, getSide, getSize, getSource, getTime, getTimeNanoPart, getTimeNanos, getTimeSequence, setCount, setEventFlags, setExchangeCode, setIndex, setLevel, setOrderSide, setPrice, setScope, setSequence, setSide, setSize, setSource, setTime, setTimeNanoPart, setTimeNanos, setTimeSequence
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 © 2017 Devexperts. All Rights Reserved.