com.apama.marketdata
Event DepthPublisher


This event can be used to add depth publishing capabilities to a service.

This event does all the book keeping associated with depth publishing such as reference counting and caching depth information to resend to new depth subscribers.

There are two ways of setting the depth data. Either it can be set explicitly by passing in explicit sequences of prices and quantities, or it can be modified incrementally. The incremental technique is often the most efficient as it doesn't involve allocating new sequences of prices and quantities.
Since:
CMF 1.1.0
Version:
10.2
Routes:
com.apama.marketdata.Depth - This depth publisher publishes depth
com.apama.marketdata.DepthRefCount0 - To indicate when the reference count for this depth source goes to 0. Many adapters will spawn new instances to handle a datasource, they will use this event to kill off those instances when no longer needed.
com.apama.marketdata.DepthSubscriptionError - This event communicates status information about the depth source
Sends:
com.apama.marketdata.Depth - 
com.apama.marketdata.DepthRefCount0 - 
com.apama.marketdata.DepthSubscriptionError - 
Listens:
com.apama.marketdata.SubscribeDepth - The depth publisher reference counts subscriptions to the depth data
com.apama.marketdata.SubscribeDepthFromContext - 
com.apama.marketdata.UnsubscribeDepth - The depth publisher reference counts subscriptions to the depth data
com.apama.marketdata.UnsubscribeDepthFromContext - 

Member summary
 integerrouteCount
 booleanrouteIt
 booleanisMultiContext
 dictionary<context, integer>outputContexts
 
Action summary
 voidchangeDepthOnAmendOrder(float oldPrice, float newPrice, integer oldQty, integer newQty, string side)

This action can be used to change the market data incrementally when an order is amended.
 voidchangeDepthOnCancelOrder(float price, integer qtyRemaining, string side)

This action can be used to change the market data incrementally when an order is cancelled.
 voidchangeDepthOnFillOrders(float price, integer qty, string side)

This action can be used to change the market data incrementally when an order is filled.
 voidchangeDepthOnNewOrder(float price, integer qty, string side)

This action can be used to change the market data incrementally, adding a new order to the book.
 voidcreatePublisher(com.apama.marketdata.DepthKey key, boolean validData)

This constructor action will create a depth publisher for the source described by the depth key.
 voidcreatePublisherFromSubscription(com.apama.marketdata.SubscribeDepth subscription, boolean validData)

This constructor action will create a depth publisher with a market data key set from a subscription event.
 voiddestroyPublisher()

This action can be used to destroy the publisher created by either constructor.
 com.apama.marketdata.DepthKeygetKey()

This action gives access to the depth key containing the source details of the publisher.
 integergetSubscribers()

This action gives access to the number of current subscribers to the depth data.
 voidhandleSubscription(com.apama.marketdata.SubscribeDepth sub)
 voidhandleUnsubscription(com.apama.marketdata.UnsubscribeDepth unsub)
 booleanisDataValid()

This action returns whether the data is currently valid.
 voidsetData(sequence<float> bidPrices, sequence<integer> bidQuantities, sequence<float> askPrices, sequence<integer> askQuantities)

This action can be used to set the data to be published.
 voidsetDataValid(boolean validData)

This action can be used to set whether the data is currently valid.
 voidsetDataWithExtraParams(sequence<float> bidPrices, sequence<integer> bidQuantities, sequence<float> askPrices, sequence<integer> askQuantities, dictionary<string, string> extraParams)

This action can be used to set the data to be published. It specifies both the main data and the extra parameters.
 voidsetExtraParams(dictionary<string, string> extraParams)

This action can be used to set data to be published. It specifies the extra parameters.
 voidsetPublisherStatus(boolean killPublisher, string status)

This action sets the publisher status. This is communicated using the DepthSubscriptionError event.
 
Member detail

isMultiContext

boolean isMultiContext

outputContexts

dictionary<context, integer> outputContexts

routeCount

integer routeCount

routeIt

boolean routeIt

Action detail

changeDepthOnAmendOrder

void changeDepthOnAmendOrder(float oldPrice, float newPrice, integer oldQty, integer newQty, string side)
This action can be used to change the market data incrementally when an order is amended.
Parameters:
oldPrice - The price the order was previously at
newPrice - The price the order has been amended to
oldQty - The qty the order used to have
newQty - The qty the order has been amended to
side - The side the order is on

changeDepthOnCancelOrder

void changeDepthOnCancelOrder(float price, integer qtyRemaining, string side)
This action can be used to change the market data incrementally when an order is cancelled.
Parameters:
price - The price of the cancelled order
qtyRemaining - The remaining qty of the cancelled order
side - The side the order was on

changeDepthOnFillOrders

void changeDepthOnFillOrders(float price, integer qty, string side)
This action can be used to change the market data incrementally when an order is filled.
Parameters:
price - The price of the order filled
qty - The qty of the order filled
side - The side the order is on

changeDepthOnNewOrder

void changeDepthOnNewOrder(float price, integer qty, string side)
This action can be used to change the market data incrementally, adding a new order to the book.
Parameters:
price - The price the additional depth should be added at
qty - The depth to add to the book
side - The side to add the depth to

createPublisher

void createPublisher(com.apama.marketdata.DepthKey key, boolean validData)
This constructor action will create a depth publisher for the source described by the depth key.
Parameters:
key - The depth key containing the source details of this publisher
validData - This parameter determines whether the depth data is valid to begin with, if it isn't valid it wont be published.

createPublisherFromSubscription

void createPublisherFromSubscription(com.apama.marketdata.SubscribeDepth subscription, boolean validData)
This constructor action will create a depth publisher with a market data key set from a subscription event.
Parameters:
subscription - The subscription is used to set the source details of the publisher
validData - This parameter determines whether the depth data is valid to begin with, if it isn't valid it wont be published.
See Also:
com.apama.marketdata.DepthKey - The depth key is used to store the source details of this publisher

destroyPublisher

void destroyPublisher()
This action can be used to destroy the publisher created by either constructor.
See Also:
com.apama.marketdata.DepthPublisher#createPublisher() - One constructor
com.apama.marketdata.DepthPublisher#createPublisherFromSubscription() - The other constructor

getKey

com.apama.marketdata.DepthKey getKey()
This action gives access to the depth key containing the source details of the publisher.
Returns:
The depth key

getSubscribers

integer getSubscribers()
This action gives access to the number of current subscribers to the depth data.
Returns:
The number of subscribers

handleSubscription

void handleSubscription(com.apama.marketdata.SubscribeDepth sub)
Parameters:
sub

handleUnsubscription

void handleUnsubscription(com.apama.marketdata.UnsubscribeDepth unsub)
Parameters:
unsub
Routes:
com.apama.marketdata.DepthRefCount0 - 
Sends:
com.apama.marketdata.DepthRefCount0 - 

isDataValid

boolean isDataValid()
This action returns whether the data is currently valid.
Returns:
Whether the data is currently valid

setData

void setData(sequence<float> bidPrices, sequence<integer> bidQuantities, sequence<float> askPrices, sequence<integer> askQuantities)
This action can be used to set the data to be published.
Parameters:
bidPrices - The new bid prices to publish
bidQuantities - The new bid quantities to publish
askPrices - The new ask prices to publish
askQuantities - The new ask quantities to publish

setDataValid

void setDataValid(boolean validData)
This action can be used to set whether the data is currently valid.

When the data is invalid it is not published. This is useful if you want to apply a number of changes as one transaction before an update is sent. When the data is set to valid again, and if it has changed, a Depth event will be routed immediately.
Parameters:
validData - Whether the data should be marked valid or not.

setDataWithExtraParams

void setDataWithExtraParams(sequence<float> bidPrices, sequence<integer> bidQuantities, sequence<float> askPrices, sequence<integer> askQuantities, dictionary<string, string> extraParams)
This action can be used to set the data to be published. It specifies both the main data and the extra parameters.
Parameters:
bidPrices - The new bid prices to publish
bidQuantities - The new bid quantities to publish
askPrices - The new ask prices to publish
askQuantities - The new ask quantities to publish
extraParams - The new extra parameters to publish

setExtraParams

void setExtraParams(dictionary<string, string> extraParams)
This action can be used to set data to be published. It specifies the extra parameters.
Parameters:
extraParams - The new extra parameters to publish

setPublisherStatus

void setPublisherStatus(boolean killPublisher, string status)
This action sets the publisher status. This is communicated using the DepthSubscriptionError event.
Parameters:
killPublisher - Whether there has been an unrecoverable failure
status - The status message to publish
Routes:
com.apama.marketdata.DepthSubscriptionError - The status data published
Sends:
com.apama.marketdata.DepthSubscriptionError -