com.dxfeed.event.market
Class Order

java.lang.Object
  extended by com.dxfeed.event.market.MarketEvent
      extended by com.dxfeed.event.market.Order
All Implemented Interfaces:
IndexedEvent, Serializable

public final class Order
extends MarketEvent
implements IndexedEvent

Order event is a snapshot for a full available market depth for a symbol. The collection of order events of a symbol represent the most recent information that is available about orders on the market at any given moment of time. Order objects give multiple level of details about the actual buy and sell orders that are working in the market. Level of detail of the given order is retrieved with getLevel method.

Order events arrive from multiple sources for the same market symbol are are distinguished by their index. Index is a unique per symbol identifier of the event. The event with getSize() == 0 is a signal to remove previously received order for the corresponding index.

Events from finer-grained level of detail give more information and include events from coarse-grained level 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.

Limitations

This event type cannot be used with DXFeed.getLastEvent method.

The subscription for this event type cannot be mixed with subscription for a regular best Quote in the same DXFeedSubscription object.

Implementation details

This event is implemented on top of QDS record Quote for composite quotes with LEVEL_COMPOSITE, record Quote&X for regional exchange best quotes with LEVEL_REGIONAL, and record MarketMaker for market-maker quotes and futures price level aggregates with LEVEL_AGGREGATE. The most fine-grained LEVEL_ORDER is not currently implemented.

See Also:
Serialized Form

Field Summary
static int LEVEL_AGGREGATE
          Represents aggregate information for each price level or best bid and offer for each market maker.
static int LEVEL_COMPOSITE
          Represents best bid and offer.
static int LEVEL_ORDER
          Represents individual order at the market.
static int LEVEL_REGIONAL
          Represents best bid and offer for a given exchange code.
static int SIDE_BUY
          Order to buy (bid).
static int SIDE_SELL
          Order to sell (ask or offer).
 
Constructor Summary
Order()
          Creates new order with default values.
Order(String eventSymbol)
          Creates new order with the specified event symbol.
 
Method Summary
 char getExchangeCode()
          Returns exchange code of this order.
 long getIndex()
          Returns unique per-symbol index of this order.
 int getLevel()
          Returns detail level of this order.
 String getMarketMaker()
          Returns market maker or other aggregate identifier of this order.
 double getPrice()
          Returns price of this order.
 int getSide()
          Returns side of this order on the market.
 long getSize()
          Returns size of this order.
 long getTime()
          Returns time of this order.
 void setExchangeCode(char exchangeCode)
          Changes exchange code of this order.
 void setIndex(long index)
          Changes unique per-symbol index of this order.
 void setLevel(int level)
          Changes detail level of this order.
 void setMarketMaker(String marketMaker)
          Changes market maker or other aggregate identifier of this order.
 void setPrice(double price)
          Changes price of this order.
 void setSide(int side)
          Changes side of this order on the market.
 void setSize(long size)
          Changes size of this order.
 void setTime(long time)
          Changes time of this order.
 String toString()
          Returns string representation of this order event.
 
Methods inherited from class com.dxfeed.event.market.MarketEvent
getEventSymbol, setEventSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIDE_BUY

public static final int SIDE_BUY
Order to buy (bid).

See Also:
getSide(), Constant Field Values

SIDE_SELL

public static final int SIDE_SELL
Order to sell (ask or offer).

See Also:
getSide(), Constant Field Values

LEVEL_COMPOSITE

public static final int LEVEL_COMPOSITE
Represents best bid and offer. Events with this level have exchangeCode == '\0' and marketMaker == null.

See Also:
getLevel(), getExchangeCode(), getMarketMaker(), Constant Field Values

LEVEL_REGIONAL

public static final int LEVEL_REGIONAL
Represents best bid and offer for a given exchange code. Events with this level have exchangeCode != '\0' and marketMaker == null.

See Also:
getLevel(), getExchangeCode(), getMarketMaker(), Constant Field Values

LEVEL_AGGREGATE

public static final int LEVEL_AGGREGATE
Represents aggregate information for each price level or best bid and offer for each market maker. Events with this level have exchangeCode != '\0' and marketMaker != null.

See Also:
getLevel(), getExchangeCode(), getMarketMaker(), Constant Field Values

LEVEL_ORDER

public static final int LEVEL_ORDER
Represents individual order at the market. Events with this level have exchangeCode != '\0' and may optionally have marketMaker specified.

See Also:
getLevel(), getExchangeCode(), getMarketMaker(), Constant Field Values
Constructor Detail

Order

public Order()
Creates new order with default values.


Order

public Order(String eventSymbol)
Creates new order with the specified event symbol.

Parameters:
eventSymbol - event symbol.
Method Detail

getIndex

public long getIndex()
Returns unique per-symbol index of this order.

Specified by:
getIndex in interface IndexedEvent
Returns:
unique per-symbol index of this order.

setIndex

public void setIndex(long index)
Changes unique per-symbol index of this order.

Parameters:
index - unique per-symbol index of this order.

getSide

public int getSide()
Returns side of this order on the market. SIDE_BUY corresponds to buy order (bid), SIDE_SELL corresponds to sell order (ask or offer).

Returns:
side of this order.

setSide

public void setSide(int side)
Changes side of this order on the market. SIDE_BUY corresponds to buy order (bid), SIDE_SELL corresponds to sell order (ask or offer).


getLevel

public int getLevel()
Returns detail level of this order.

Returns:
detail level of this order.
See Also:
LEVEL_COMPOSITE, LEVEL_REGIONAL, LEVEL_AGGREGATE, LEVEL_ORDER

setLevel

public void setLevel(int level)
Changes detail level of this order.

Parameters:
level - detail level of this order.
See Also:
LEVEL_COMPOSITE, LEVEL_REGIONAL, LEVEL_AGGREGATE, LEVEL_ORDER

getTime

public long getTime()
Returns time of this order. Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.

Returns:
time of this order.

setTime

public void setTime(long time)
Changes time of this order. Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.

Parameters:
time - time of this order.

getExchangeCode

public char getExchangeCode()
Returns exchange code of this order.

Returns:
exchange code of this order.

setExchangeCode

public void setExchangeCode(char exchangeCode)
Changes exchange code of this order.

Parameters:
exchangeCode - exchange code of this order.

getMarketMaker

public String getMarketMaker()
Returns market maker or other aggregate identifier of this order. This value is defined only for LEVEL_AGGREGATE orders.

Returns:
market maker or other aggregate identifier of this order.

setMarketMaker

public void setMarketMaker(String marketMaker)
Changes market maker or other aggregate identifier of this order.

Parameters:
marketMaker - market maker or other aggregate identifier of this order.

getPrice

public double getPrice()
Returns price of this order.

Returns:
price of this order.

setPrice

public void setPrice(double price)
Changes price of this order.

Parameters:
price - price of this order.

getSize

public long getSize()
Returns size of this order.

Returns:
size of this order.

setSize

public void setSize(long size)
Changes size of this order.

Parameters:
size - size of this order.

toString

public String toString()
Returns string representation of this order event.

Overrides:
toString in class Object
Returns:
string representation of this order event.


Copyright © 2013 Devexperts. All Rights Reserved.