com.apama.sor.oms
Event ChildOrderContainer


The ChildOrderContainer event helper provides a container for executing orders.
Since:
CMF 2.1.0
Routes:
com.apama.oms.AmendOrder - Routed in response to a call to the amend action
com.apama.oms.CancelOrder - Routed in response to a call to the cancel action
com.apama.oms.NewOrder - Routed in response to a call to the submit action
com.apama.sor.oms.OrderChangeAccepted - Routed when a change request is accepted
com.apama.sor.oms.OrderChangeRejected - Routed when a change request is rejected
com.apama.sor.oms.OrderFinal - Routed when the order state is final
com.apama.sor.oms.OrderUpdate - Routed when the order is updated
Sends:
com.apama.oms.AmendOrder - 
com.apama.oms.CancelOrder - 
com.apama.oms.NewOrder - 
Listens:
com.apama.oms.OrderUpdate - 

Member summary
 wildcard stringid
 wildcard stringname
 dictionary<string, string>metadata
 com.apama.sor.oms.OrderStatestate
 com.apama.oms.NewOrderorder
 com.apama.oms.OrderUpdateupdate
 com.apama.sor.oms.OrderDataViewdvOrder
 wildcard booleanfillsFromLastShares
 wildcard contextmainContext
 wildcard contextorderContext
 
Action summary
 booleanamend(float price, string type, integer quantity, dictionary<string, string> extraParams, com.apama.sor.oms.ChildOrderNormaliserInterface normaliser)

Amend the price or quantity of the order.
 booleancancel(dictionary<string, string> extraParams, com.apama.sor.oms.ChildOrderNormaliserInterface normaliser)

Cancel the order. The action creates a com.apama.oms.CancelOrder event which is routed, the state of the OrderContainer is changed to pending cancel and the dataview item is updated.
 voidcreate(string id, context mainContext, context orderContext, dictionary<string, string> metadata, boolean fillsFromLastShares, string dvName)

Constructor to create a new order container from a com.apama.oms.NewOrder.
 floatgetAvgPrice()
 dictionary<string, string>getExtraParams()
 stringgetId()
 floatgetLastPrice()
 integergetLastShares()
 stringgetMarketId()
 stringgetMetadata(string key, string def)
 com.apama.oms.NewOrdergetOrder()
 floatgetPrice()
 integergetQty()
 integergetQtyExecuted()
 integergetQtyRemaining()
 stringgetServiceId()
 stringgetSide()
 com.apama.sor.oms.OrderStategetState()
 stringgetSymbol()
 stringgetType()
 com.apama.oms.OrderUpdategetUpdate()
 voidlogAmendOrder(string header, com.apama.oms.AmendOrder amendOrder)

Utility to pretty print an AmendOrder event to log file.
 voidlogCancelOrder(string header, com.apama.oms.CancelOrder cancelOrder)

Utility to pretty print a CancelOrder event to log file.
 voidlogNewOrder(string header, com.apama.oms.NewOrder newOrder)

Utility to pretty print a NewOrder event to log file. To print the current order details used logNewOrder.
 voidlogOrder(string header)

Utility action to pretty print the order details for the child order container.
 voidlogOrderUpdate(string header, com.apama.oms.OrderUpdate update)

Utility to log an order update.
 voidlogUpdate(string header)

Utility action to pretty print the last order update for the child order container.
 voidrestart()

Reload the order details from a snapshot of the current order details. Sets up the update listeners and creates the dataview for the order. This method should be called after the set() action.
 voidset(com.apama.sor.oms.OrderState state, com.apama.oms.NewOrder order, com.apama.oms.OrderUpdate update)

Set the order details that are usually built up during the lifetime execution of the order i.e. state, com.apama.oms.NewOrder values, and com.apama.oms.OrderUpdate. Used for reloading of the details before starting the update listeners.
 voidsubmit(string symbol, float price, string side, string type, integer quantity, string serviceId, string marketId, string ownerId, dictionary<string, string> extraParams, com.apama.sor.oms.ChildOrderNormaliserInterface normaliser)

Submit the order based on the parameters passed into the action.
 
Member detail

dvOrder

            com.apama.sor.oms.OrderDataView dvOrder
        

fillsFromLastShares

            wildcard boolean fillsFromLastShares
        

id

            wildcard string id
        

mainContext

            wildcard context mainContext
        

metadata

            dictionary<string, string> metadata
        

name

            wildcard string name
        

order

            com.apama.oms.NewOrder order
        

orderContext

            wildcard context orderContext
        

state

            com.apama.sor.oms.OrderState state
        

update

            com.apama.oms.OrderUpdate update
        

Action detail

amend

            boolean amend(float price, string type, integer quantity, dictionary<string, string> extraParams, com.apama.sor.oms.ChildOrderNormaliserInterface normaliser)
        
Amend the price or quantity of the order.

The action creates a com.apama.oms.AmendOrder event from the parameters passed into the action, and the orders initial parameters. The AmendOrder event is routed, the state of the OrderContainer is changed to pending change and the dataview item updated.
Parameters:
price - The price to amend the order to
type
quantity - The quantity to amend the order to
extraParams
normaliser
Routes:
com.apama.oms.AmendOrder - The AmendOrder event
Sends:
com.apama.oms.AmendOrder - 

cancel

            boolean cancel(dictionary<string, string> extraParams, com.apama.sor.oms.ChildOrderNormaliserInterface normaliser)
        
Cancel the order. The action creates a com.apama.oms.CancelOrder event which is routed, the state of the OrderContainer is changed to pending cancel and the dataview item is updated.
Parameters:
extraParams
normaliser
Routes:
com.apama.oms.CancelOrder - The CancelOrder event
Sends:
com.apama.oms.CancelOrder - 

create

            void create(string id, context mainContext, context orderContext, dictionary<string, string> metadata, boolean fillsFromLastShares, string dvName)
        
Constructor to create a new order container from a com.apama.oms.NewOrder.
Parameters:
id - The id of the OrderContainer instance (should be unique)
mainContext - The main context
orderContext - The context where orders or updates need to be sent to
metadata - Allows setting arbitrary metadata about the order for storage
fillsFromLastShares - Set to true if fills are taken from the lastShares of the OrderUpdate
dvName - The dataview name for data visualisation

getAvgPrice

            float getAvgPrice()
        

getExtraParams

            dictionary<string, string> getExtraParams()
        

getId

            string getId()
        

getLastPrice

            float getLastPrice()
        

getLastShares

            integer getLastShares()
        

getMarketId

            string getMarketId()
        

getMetadata

            string getMetadata(string key, string def)
        
Parameters:
key
def

getOrder

            com.apama.oms.NewOrder getOrder()
        

getPrice

            float getPrice()
        

getQty

            integer getQty()
        

getQtyExecuted

            integer getQtyExecuted()
        

getQtyRemaining

            integer getQtyRemaining()
        

getServiceId

            string getServiceId()
        

getSide

            string getSide()
        

getState

            com.apama.sor.oms.OrderState getState()
        

getSymbol

            string getSymbol()
        

getType

            string getType()
        

getUpdate

            com.apama.oms.OrderUpdate getUpdate()
        

logAmendOrder

            void logAmendOrder(string header, com.apama.oms.AmendOrder amendOrder)
        
Utility to pretty print an AmendOrder event to log file.
Parameters:
header - A header message to be logged before the new order event
amendOrder

logCancelOrder

            void logCancelOrder(string header, com.apama.oms.CancelOrder cancelOrder)
        
Utility to pretty print a CancelOrder event to log file.
Parameters:
header - A header message to be logged before the cancel order event
cancelOrder

logNewOrder

            void logNewOrder(string header, com.apama.oms.NewOrder newOrder)
        
Utility to pretty print a NewOrder event to log file. To print the current order details used logNewOrder.
Parameters:
header - A header message to be logged before the new order event
newOrder - The com.apama.oms.NewOrder event to be logged

logOrder

            void logOrder(string header)
        
Utility action to pretty print the order details for the child order container.
Parameters:
header - A header message to be logged before the new order event

logOrderUpdate

            void logOrderUpdate(string header, com.apama.oms.OrderUpdate update)
        
Utility to log an order update.
Parameters:
header - A header message to be logged before the update
update

logUpdate

            void logUpdate(string header)
        
Utility action to pretty print the last order update for the child order container.
Parameters:
header - A header message to be logged before the new order event

restart

            void restart()
        
Reload the order details from a snapshot of the current order details. Sets up the update listeners and creates the dataview for the order. This method should be called after the set() action.

set

            void set(com.apama.sor.oms.OrderState state, com.apama.oms.NewOrder order, com.apama.oms.OrderUpdate update)
        
Set the order details that are usually built up during the lifetime execution of the order i.e. state, com.apama.oms.NewOrder values, and com.apama.oms.OrderUpdate. Used for reloading of the details before starting the update listeners.
Parameters:
state - The state of the order
order - A com.apama.oms.NewOrder event giving the order details
update - A com.apama.oms.OrderUpdate event giving the most recent order update

submit

            void submit(string symbol, float price, string side, string type, integer quantity, string serviceId, string marketId, string ownerId, dictionary<string, string> extraParams, com.apama.sor.oms.ChildOrderNormaliserInterface normaliser)
        
Submit the order based on the parameters passed into the action.

The action creates a com.apama.oms.NewOrder event from the parameters which is stored in the self.order event parameter. The NewOrder is routed, the updateListener is created, and the data view item for the order is created.
Parameters:
symbol - The order symbol
price - The order price
side - The order side
type - The order type
quantity - The order quantity
serviceId - The serviceId of the service than will receive the order
marketId - The marketId of the service that will received the order
ownerId - The owner id of the order
extraParams - Any extra params to be included in the NewOrder
normaliser
Routes:
com.apama.oms.NewOrder - The NewOrder event
Sends:
com.apama.oms.NewOrder -