FRAMES NO FRAMES | ||||||
| ||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |
There are a number of actions provided by the OrderMonitorStateContainer event object that allow you to query the current state of the order being monitored. These are also available directly from the com.apama.oms.#OrderState object returned in the update handler callback. These are split into two categories, those prefixed with "is*()" and those prefixed with "just*()". The "is*()" set of actions indicate whether or not the order is currently in that state. Whereas the "just*()" set of actions determine the order state in the most recent update only. For example, justAcknowledged() will return true immediately after the order is acknowledged, but not on any subsequent updates, whereas isAcknowledged() will always return true after the order has been acknowledged.
action handleNewOrders() {
com.apama.oms.NewOrder newOrder;
on all com.apama.oms.NewOrder(serviceId="FIX", marketId="CNX"):newOrder {
com.apama.oms.OrderMonitorStateContainer mon :=
new com.apama.oms.OrderMonitorStateContainer;
mon.monitorOrder(newOrder, false);
mon.addUpdateListener("myCallback", monitorHandler);
}
}
// This action will be called every time the order state changes
action monitorHandler(integer id, com.apama.oms.OrderState state) {
if( state.isFinal() ) then {
log "Order Complete!";
}
}
Action Summary | |
---|---|
string |
_toString()
Returns a formatted string of the current order state. |
void |
addUpdateListener(string name, action<integer, com.apama.oms.OrderState > callback)
Used to add an update handler callback with the OrderMonitorStateContainer. The callback action provided will be called each time the order being monitored is updated. |
float |
getAvgPrice()
Returns the average price of execution so far. |
string |
getBookId()
Returns the Book Id. |
string |
getBrokerId()
Returns the Broker Id. |
float |
getCash()
Returns the total money executed so far. |
string |
getDeskId()
Returns the desk Id. |
string |
getExchangeId()
Returns the exchange Id. |
dictionary<string, string > |
getExtraParams()
Returns the current order extraParams. |
string |
getFirewallServiceId()
Returns the service ID to use with the firewall. |
string |
getFirewallTargetServiceId()
Returns the target service associated with the firewall. |
float |
getIssueTime()
Returns time at which the order was issued. |
integer |
getLargestExposedQuantity()
Returns largest exposed quantity. |
float |
getLastCommissionPaid()
Returns the commission paid on last trade. |
string |
getLastCounterPartyId()
Returns the counterparty for last trade. |
float |
getLastPriceExecuted()
Returns price of the last trade. |
integer |
getLastQtyExecuted()
Returns the most recent trade quantity. |
float |
getLastTradeTime()
Returns the time of last trade. |
string |
getLastTradeType()
Returns the type of last trade. |
string |
getMarketId()
Returns the Market Id. |
string |
getMarketOrderId()
Returns the market order ID. |
integer |
getMonitorId()
Returns the unique identifier of this instance of the OrderMonitorStateContainer. |
string |
getOptionalExtraParams(string param)
This action gets the provided parameter from the set of optional extra parameters. |
string |
getOrderId()
Returns the order ID. |
string |
getOriginatorServiceInstance()
Returns the service instance of the originator. |
string |
getOriginatorServiceName()
Returns the service name of the originator. |
string |
getOriginatorServiceType()
Returns the service type of the originator. |
string |
getOwnerId()
Returns the Owner Id. |
dictionary<string, string > |
getPreviousExtraParams()
Returns extraParams before the most recent change. |
integer |
getPreviousLargestExposedQuantity()
Returns previous largest exposed quantity (before the most recent update). |
float |
getPreviousPrice()
Returns order price before the most recent change. |
integer |
getPreviousQtyExecuted()
Returns quantity executed before the most recent change. |
integer |
getPreviousQtyRemaining()
Returns quantity remaining before the most recent change. |
integer |
getPreviousQuantity()
Returns order total quantity before the most recent change. |
dictionary<string, string > |
getPreviousUserSetExtraParams()
Returns user's extraParams before the most recent change; blank if extraParams have been unchanged. |
float |
getPreviousUserSetPrice()
Returns user set price before the most recent amend was applied. |
integer |
getPreviousUserSetQuantity()
Returns user set quantity before the most recent amend was applied. |
float |
getPrice()
Returns the order price. |
integer |
getQtyExecuted()
Returns the quantity executed so far. |
integer |
getQtyRemaining()
Returns the remaining order quantity. |
integer |
getQuantity()
Returns the order quantity. |
dictionary<string, string > |
getRejectedExtraParams()
Returns the most recent rejected extraParams. |
float |
getRejectedPrice()
Returns the most recent rejected price. |
integer |
getRejectedQuantity()
Returns the most recent rejected quantity. |
string |
getReservationId()
Returns the Reservation Id. |
string |
getServiceId()
Returns the service ID for the order. |
string |
getSide()
Returns the order side (BUY/SELL). |
string |
getStatus()
Returns the most recent order status message. |
com.apama.oms.NewOrder |
getSubmittedNewOrder()
Returns the submitted NewOrder. |
string |
getSymbol()
Returns the order symbol. |
string |
getType()
Returns the order type (e.g. LIMIT, MARKET, IOC, etc). |
dictionary<string, string > |
getUserSetExtraParams()
Returns any extra parameters that the User has set. |
float |
getUserSetPrice()
Returns the current user set price (should equal current price unless there is a pending amend). |
integer |
getUserSetQuantity()
Returns the current user set quantity (should equal current quantity unless there is a pending amend). |
boolean |
hasOptionalExtraParam(string param)
This action checks whether or not the provided parameter exists in the set of optional extra parameters. |
boolean |
isAcknowledged()
Returns whether or not the order has been acknowledged by the market. |
boolean |
isAmending()
Returns whether or not an amend request is currently pending. |
boolean |
isBuy()
Returns whether or not this is a buy-side order. |
boolean |
isCancelled()
Returns whether or not the order has been cancelled. |
boolean |
isCancelling()
Returns whether or not a cancel request is currently pending. |
boolean |
isExternallyModified()
Returns whether or not the order has been modified by the market. |
boolean |
isFinal()
Returns whether or not the order is in a final state. |
boolean |
isInMarket()
Returns whether or not the order is in market. |
boolean |
isLargestExposedQuantityModified()
Returns whether or not the largest exposed quantity has been changed. |
boolean |
isModifiable()
Returns whether or not the order can be modified. |
boolean |
isOrderChangeRejected()
Returns whether or not the requested change (amend/cancel) was rejected. |
boolean |
isSell()
Returns whether or not this is a sell-side order. |
boolean |
isSent()
Returns whether or not the order has been sent to the market. |
boolean |
isUnknownState()
Returns whether or not the order is in an unknown state. |
boolean |
isUsingReservation()
Returns whether or not Reservation is being used. |
boolean |
isViaFirewall()
Returns whether or not the firewall is being used. |
boolean |
isVisible()
Returns whether or not the order is currently visible. |
boolean |
justAcknowledged()
Returns whether or not the order has just been acknowledged. |
boolean |
justAmendApplied()
Returns whether or not the most recent operation was an amend being applied. |
boolean |
justAmendCommitted()
Returns whether or not the most recent change was an amend being committed. |
boolean |
justAmendRejected()
Returns whether or not an amend has just been rejected. |
boolean |
justCancelApplied()
Returns whether or not a cancel has just been requested. |
boolean |
justCancelCommitted()
Returns whether or not a cancel has just been committed. |
boolean |
justCancelRejected()
Returns whether or not a request to cancel the order has just been rejected. |
boolean |
justExecuted()
Returns whether or not the last update was a trade. |
boolean |
justFinal()
Returns whether or not the order has just become final. |
boolean |
justNew()
Returns whether or not the order has just been placed. |
boolean |
justRejected()
Returns whether or not the order has just been rejected by the firewall. |
boolean |
justSoftRejected()
Returns whether or not the order has just been soft-rejected. |
void |
monitorOrder(com.apama.oms.NewOrder order, boolean logInfoAsDebug)
This action is used to initialise an instance of the OrderMonitorStateContainer. It establishes handlers for any amends, cancels, or updates the order. When any changes occur, any registered update handler callbacks will be called. |
void |
removeUpdateListener(string name)
Used to remove a registered update handler callback from the OrderMonitorStateContainer. |
void |
stopMonitoring()
This action stops monitoring the order. |
Action Detail |
---|
string _toString()Returns a formatted string of the current order state.
void addUpdateListener(string name, action<integer, com.apama.oms.OrderState > callback)Used to add an update handler callback with the OrderMonitorStateContainer. The callback action provided will be called each time the order being monitored is updated.
float getAvgPrice()Returns the average price of execution so far.
string getBookId()Returns the Book Id.
string getBrokerId()Returns the Broker Id.
float getCash()Returns the total money executed so far.
string getDeskId()Returns the desk Id.
string getExchangeId()Returns the exchange Id.
dictionary<string, string > getExtraParams()Returns the current order extraParams.
string getFirewallServiceId()Returns the service ID to use with the firewall.
string getFirewallTargetServiceId()Returns the target service associated with the firewall.
float getIssueTime()Returns time at which the order was issued.
integer getLargestExposedQuantity()Returns largest exposed quantity.
float getLastCommissionPaid()Returns the commission paid on last trade.
string getLastCounterPartyId()Returns the counterparty for last trade.
float getLastPriceExecuted()Returns price of the last trade.
integer getLastQtyExecuted()Returns the most recent trade quantity.
float getLastTradeTime()Returns the time of last trade.
string getLastTradeType()Returns the type of last trade.
string getMarketId()Returns the Market Id.
string getMarketOrderId()Returns the market order ID.
integer getMonitorId()Returns the unique identifier of this instance of the OrderMonitorStateContainer.
string getOptionalExtraParams(string param)This action gets the provided parameter from the set of optional extra parameters.
string getOrderId()Returns the order ID.
string getOriginatorServiceInstance()Returns the service instance of the originator.
string getOriginatorServiceName()Returns the service name of the originator.
string getOriginatorServiceType()Returns the service type of the originator.
string getOwnerId()Returns the Owner Id.
dictionary<string, string > getPreviousExtraParams()Returns extraParams before the most recent change.
integer getPreviousLargestExposedQuantity()Returns previous largest exposed quantity (before the most recent update).
float getPreviousPrice()Returns order price before the most recent change.
integer getPreviousQtyExecuted()Returns quantity executed before the most recent change.
integer getPreviousQtyRemaining()Returns quantity remaining before the most recent change.
integer getPreviousQuantity()Returns order total quantity before the most recent change.
dictionary<string, string > getPreviousUserSetExtraParams()Returns user's extraParams before the most recent change; blank if extraParams have been unchanged.
float getPreviousUserSetPrice()Returns user set price before the most recent amend was applied.
integer getPreviousUserSetQuantity()Returns user set quantity before the most recent amend was applied.
float getPrice()Returns the order price.
integer getQtyExecuted()Returns the quantity executed so far.
integer getQtyRemaining()Returns the remaining order quantity.
integer getQuantity()Returns the order quantity.
dictionary<string, string > getRejectedExtraParams()Returns the most recent rejected extraParams.
float getRejectedPrice()Returns the most recent rejected price.
integer getRejectedQuantity()Returns the most recent rejected quantity.
string getReservationId()Returns the Reservation Id.
string getServiceId()Returns the service ID for the order.
string getSide()Returns the order side (BUY/SELL).
string getStatus()Returns the most recent order status message.
com.apama.oms.NewOrder getSubmittedNewOrder()Returns the submitted NewOrder.
string getSymbol()Returns the order symbol.
string getType()Returns the order type (e.g. LIMIT, MARKET, IOC, etc).
dictionary<string, string > getUserSetExtraParams()Returns any extra parameters that the User has set.
float getUserSetPrice()Returns the current user set price (should equal current price unless there is a pending amend).
integer getUserSetQuantity()Returns the current user set quantity (should equal current quantity unless there is a pending amend).
boolean hasOptionalExtraParam(string param)This action checks whether or not the provided parameter exists in the set of optional extra parameters.
boolean isAcknowledged()Returns whether or not the order has been acknowledged by the market.
boolean isAmending()Returns whether or not an amend request is currently pending.
boolean isBuy()Returns whether or not this is a buy-side order.
boolean isCancelled()Returns whether or not the order has been cancelled.
boolean isCancelling()Returns whether or not a cancel request is currently pending.
boolean isExternallyModified()Returns whether or not the order has been modified by the market.
boolean isFinal()Returns whether or not the order is in a final state.
boolean isInMarket()Returns whether or not the order is in market.
boolean isLargestExposedQuantityModified()Returns whether or not the largest exposed quantity has been changed.
boolean isModifiable()Returns whether or not the order can be modified.
boolean isOrderChangeRejected()Returns whether or not the requested change (amend/cancel) was rejected.
boolean isSell()Returns whether or not this is a sell-side order.
boolean isSent()Returns whether or not the order has been sent to the market.
boolean isUnknownState()Returns whether or not the order is in an unknown state.
boolean isUsingReservation()Returns whether or not Reservation is being used.
boolean isViaFirewall()Returns whether or not the firewall is being used.
boolean isVisible()Returns whether or not the order is currently visible.
boolean justAcknowledged()Returns whether or not the order has just been acknowledged.
boolean justAmendApplied()Returns whether or not the most recent operation was an amend being applied.
boolean justAmendCommitted()Returns whether or not the most recent change was an amend being committed.
boolean justAmendRejected()Returns whether or not an amend has just been rejected.
boolean justCancelApplied()Returns whether or not a cancel has just been requested.
boolean justCancelCommitted()Returns whether or not a cancel has just been committed.
boolean justCancelRejected()Returns whether or not a request to cancel the order has just been rejected.
boolean justExecuted()Returns whether or not the last update was a trade.
boolean justFinal()Returns whether or not the order has just become final.
boolean justNew()Returns whether or not the order has just been placed.
boolean justRejected()Returns whether or not the order has just been rejected by the firewall.
boolean justSoftRejected()Returns whether or not the order has just been soft-rejected.
void monitorOrder(com.apama.oms.NewOrder order, boolean logInfoAsDebug)This action is used to initialise an instance of the OrderMonitorStateContainer. It establishes handlers for any amends, cancels, or updates the order. When any changes occur, any registered update handler callbacks will be called.
void removeUpdateListener(string name)Used to remove a registered update handler callback from the OrderMonitorStateContainer.
void stopMonitoring()This action stops monitoring the order.
FRAMES NO FRAMES | ||||||
| ||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |