com.apama.oms
Event OrderBook


Order Book event object for use in simulators, dark pools &c. Keeps an ordered list of Buys and Sells suitable for matching algos.
Since:
CMF 1.1.0
Version:
10.7}

Member summary
 wildcard booleanwantPublishDepth

Flag to indicate whether user wants depth updates to be published.
 wildcard booleanwantDataview

Flag to indicate whether user requests dataviews for orders in the book to be set up.
 sequence<string>buyCache
 sequence<string>sellCache
 dictionary<string, com.apama.oms.OrderReceiverStateContainer>orderState
 com.apama.marketdata.DepthPublisherdepthPublisher
 com.apama.marketdata.TickPublishertradePublisher
 com.apama.oms.OrderBookDataViewOBDV
 stringprefix
 com.apama.oms.ConstantsOMSConsts
 stringbookId
 com.apama.oms.BookIteratorbuyIterator
 com.apama.oms.BookIteratorsellIterator
 
Action summary
 voidaddOrder(com.apama.oms.OrderReceiverStateContainer order, integer priority)

Used to add an order to the book.
 voidcleanBook()

Used to clean the book. This operation will automatically cancel all the orders. The ondie action of monitors using this object event should call this method to avoid haemorrhaging orders.
 voidcreateBook(string bookId, com.apama.marketdata.MarketDataKey omsOutputKey, com.apama.marketdata.MarketDataKey mdOutputKey, boolean wantPublishDepth, boolean wantDataview, context mainCtx)

Constructor used to create a book.
 com.apama.oms.OrderReceiverStateContainergetNextBuy()

Used to obtain the next order object via the bid side iterator.
 com.apama.oms.OrderReceiverStateContainergetNextSell()

Used to obtain the next order object via the ask side iterator.
 com.apama.oms.OrderReceiverStateContainergetOrder(string orderId)

Used to obtain the OrderReceiverStateContainer object for an order.
 com.apama.oms.OrderReceiverStateContainergetTopBuy()

Returns the best bid. Make sure to use the protective action to check whether best-bid exists first.
 com.apama.oms.OrderReceiverStateContainergetTopSell()

Returns the best ask. Make sure to use the protective action to check whether best-ask exists first.
 booleanhasNextBuy()

Used to check if there is a next bid value.
 booleanhasNextSell()

Used to check if there is a next ask value.
 booleanhasOrder(string orderId)

Used to check if a specific order exists.
 booleanhasTopBuy()

Returns flag for availability of best bid.
 booleanhasTopSell()

Returns flag for availability of best ask.
 voidpublishDepth()

Used for publishing aggregated book depth.
 voidremoveOrder(string orderId, boolean isInCache)

Used to remove an order from the orderbook. The action does not cancel the order, thus allowing the code using the book to reject cancel or fill at will.
 stringrenderBuyCache()

Used to obtain a stringified version of the id/price of all orders on the buy side.
 stringrenderDepth()
 stringrenderSellCache()

Used to obtain a stringified version of the id/price of all orders on the ask side.
 voidresetBuyIterator()

Used to reset book's bid side iterator.
 voidresetSellIterator()

Used to reset book's ask side iterator.
 voidserverAmendOrder(string orderId, com.apama.oms.AmendOrder amend, integer newPriority)

Used to amend an order in the book, where the amend is generated by the server.
 voiduserAmendOrder(string orderId, com.apama.oms.AmendOrder amend, integer newPriority)

Used to amend an order in the book.
 
Member detail

bookId

string bookId

buyCache

sequence<string> buyCache

buyIterator

com.apama.oms.BookIterator buyIterator

depthPublisher

com.apama.marketdata.DepthPublisher depthPublisher

OBDV

com.apama.oms.OrderBookDataView OBDV

OMSConsts

com.apama.oms.Constants OMSConsts

orderState

dictionary<string, com.apama.oms.OrderReceiverStateContainerorderState

prefix

string prefix

sellCache

sequence<string> sellCache

sellIterator

com.apama.oms.BookIterator sellIterator

tradePublisher

com.apama.marketdata.TickPublisher tradePublisher

wantDataview

wildcard boolean wantDataview
Flag to indicate whether user requests dataviews for orders in the book to be set up.

wantPublishDepth

wildcard boolean wantPublishDepth
Flag to indicate whether user wants depth updates to be published.
Action detail

addOrder

void addOrder(com.apama.oms.OrderReceiverStateContainer order, integer priority)
Used to add an order to the book.
Parameters:
order - The OrderReceiverStateContainer which holds the order details
priority

cleanBook

void cleanBook()
Used to clean the book. This operation will automatically cancel all the orders. The ondie action of monitors using this object event should call this method to avoid haemorrhaging orders.

createBook

void createBook(string bookId, com.apama.marketdata.MarketDataKey omsOutputKey, com.apama.marketdata.MarketDataKey mdOutputKey, boolean wantPublishDepth, boolean wantDataview, context mainCtx)
Constructor used to create a book.
Parameters:
bookId - An ID for this book
omsOutputKey - The depth key used when publishing order execution messages
mdOutputKey - The depth key used when publishing depth data
wantPublishDepth - Whether to publish depth or not
wantDataview - Whether to create a dataview or not
mainCtx

getNextBuy

com.apama.oms.OrderReceiverStateContainer getNextBuy()
Used to obtain the next order object via the bid side iterator.
Returns:
The next bid side order via the buy side iterator

getNextSell

com.apama.oms.OrderReceiverStateContainer getNextSell()
Used to obtain the next order object via the ask side iterator.
Returns:
The next ask side order via the sell side iterator

getOrder

com.apama.oms.OrderReceiverStateContainer getOrder(string orderId)
Used to obtain the OrderReceiverStateContainer object for an order.
Parameters:
orderId - The unique identifier for the order being requested
Returns:
The OrderReceiverStateContainer which contains the details for the order being requested

getTopBuy

com.apama.oms.OrderReceiverStateContainer getTopBuy()
Returns the best bid. Make sure to use the protective action to check whether best-bid exists first.
Returns:
Best bid in an OrderReceiverStateContainer object

getTopSell

com.apama.oms.OrderReceiverStateContainer getTopSell()
Returns the best ask. Make sure to use the protective action to check whether best-ask exists first.
Returns:
Best ask in an OrderReceiverStateContainer object

hasNextBuy

boolean hasNextBuy()
Used to check if there is a next bid value.
Returns:
True if iterator has finds next bid value and false otherwise

hasNextSell

boolean hasNextSell()
Used to check if there is a next ask value.
Returns:
True if iterator has finds next ask value and false otherwise

hasOrder

boolean hasOrder(string orderId)
Used to check if a specific order exists.
Parameters:
orderId - The unique identifier for the order being checked
Returns:
True if the order exists and false otherwise

hasTopBuy

boolean hasTopBuy()
Returns flag for availability of best bid.
Returns:
true if best bid is available and false otherwise

hasTopSell

boolean hasTopSell()
Returns flag for availability of best ask.
Returns:
True if best ask is available and false otherwise

publishDepth

void publishDepth()
Used for publishing aggregated book depth.

removeOrder

void removeOrder(string orderId, boolean isInCache)
Used to remove an order from the orderbook. The action does not cancel the order, thus allowing the code using the book to reject cancel or fill at will.
Parameters:
orderId - The unique identifier of the order being removed from the book
isInCache

renderBuyCache

string renderBuyCache()
Used to obtain a stringified version of the id/price of all orders on the buy side.
Returns:
The stringified representation of the orders and their prices on the bid side

renderDepth

string renderDepth()

renderSellCache

string renderSellCache()
Used to obtain a stringified version of the id/price of all orders on the ask side.
Returns:
The stringified representation of the orders and their prices on the ask side

resetBuyIterator

void resetBuyIterator()
Used to reset book's bid side iterator.

resetSellIterator

void resetSellIterator()
Used to reset book's ask side iterator.

serverAmendOrder

void serverAmendOrder(string orderId, com.apama.oms.AmendOrder amend, integer newPriority)
Used to amend an order in the book, where the amend is generated by the server.
Parameters:
orderId - The unique identifier of the order being amended
amend - Details of the amendment request
newPriority - The priority the order will have after the amend.

userAmendOrder

void userAmendOrder(string orderId, com.apama.oms.AmendOrder amend, integer newPriority)
Used to amend an order in the book.
Parameters:
orderId - The unique identifier of the order being amended
amend - Details of the amendment request
newPriority - The priority the order will have after the amend.