FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |
There are a number of actions provided by the OrderPublisherStateContainer 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 sendOrder() {
com.apama.oms.OrderEventConstants const :=new com.apama.oms.OrderEventConstants;
com.apama.oms.OrderPublisherStateContainer pub :=
new com.apama.oms.OrderPublisherStateContainer;
pub.submitQuick("EUR/USD", "FIX", "CNX", "", const.MARKET_ORDER(),
const.SELL_SIDE(), 1.20365, 10000000, false);
// Monitor changes to the order
pub.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 OrderPublisherStateContainer. The callback action provided will be called each time the order being published is updated. |
void |
amend(float price, integer qty, dictionary<string, string > extraParams)
This action requests an amend of the order that was submitted by the OrderPublisherStateContainer. Only the price, quantity and extra parameters may be changed on the order. |
boolean |
canAmend(float price, integer qty, dictionary<string, string > extraParams)
This action indicates whether or not the current order can be amended to the price, quantity and extraParams specified. |
boolean |
canCancel(dictionary<string, string > extraParams)
This action indicates whether or not the current order can be Cancelled. |
void |
cancel()
This action requests a Cancel of the order associated with this OrderPublisherStateContainer. In this variant of the cancel action, no extraParams are used in the cancel request. |
void |
cancelWithExtraParams(dictionary<string, string > extraParams)
This action requests a Cancel of the order associated with this OrderPublisherStateContainer. In this variant of the cancel action, the user can specify a set of extraParams to be used in the cancel request. |
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. |
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 |
getPubId()
Returns the unique identifier of this instance of the OrderPublisherStateContainer. |
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 |
removeUpdateListener(string name)
Used to remove a registered update handler callback from the OrderPublisherStateContainer. |
void |
submit(com.apama.oms.NewOrder order, boolean logInfoAsDebug)
This action submits an order using a fully initialised com.apama.oms.NewOrder event. |
void |
submitParallel(com.apama.oms.NewOrder order, boolean logInfoAsDebug, context destinationCtx)
Establishes and initialises the order publisher. Establishes handlers for amend, cancel, update messages then runs the callbacks. |
void |
submitParallelQuick(string symbol, string service, string market, string exchange, string type, string side, float price, integer quantity, boolean logInfoAsDebug, context destinationCtx)
Used for direct submission without the need to create a NewOrder event. |
void |
submitParallelQuickViaFirewall(string firewallServiceId, string symbol, string service, string market, string exchange, string type, string side, float price, integer quantity, boolean logInfoAsDebug, context destinationCtx)
Used for direct submission without the need to create a NewOrder event. |
void |
submitParallelQuickViaFirewallAgainstReservation(string firewallServiceId, string reservationId, string symbol, string service, string market, string exchange, string type, string side, float price, integer quantity, boolean logInfoAsDebug, context destinationCtx)
Used for direct submission without the need to create a NewOrder event; uses reservation. |
void |
submitParallelViaFirewall(string firewallServiceId, com.apama.oms.NewOrder order, boolean logInfoAsDebug, context destinationCtx)
Used to submit an order via the firewall system. |
void |
submitParallelViaFirewallAgainstReservation(string firewallServiceId, string reservationId, com.apama.oms.NewOrder order, boolean logInfoAsDebug, context destinationCtx)
Used to submit an order via the firewall system. |
void |
submitQuick(string symbol, string service, string market, string exchange, string type, string side, float price, integer quantity, boolean logInfoAsDebug)
This action submits an order but only requires that a minimal set of parameters are provided. |
void |
submitQuickViaFirewall(string firewallServiceId, string symbol, string service, string market, string exchange, string type, string side, float price, integer quantity, boolean logInfoAsDebug)
This action submits an order against the CMF Risk Firewall, but only requires that a minimal set of parameters are provided. |
void |
submitQuickViaFirewallAgainstReservation(string firewallServiceId, string reservationId, string symbol, string service, string market, string exchange, string type, string side, float price, integer quantity, boolean logInfoAsDebug)
This action submits a order against the CMF Risk Firewall with the identifier of a corresponding Reservation order, but only requires that a minimal set of parameters are provided. |
void |
submitViaFirewall(string firewallServiceId, com.apama.oms.NewOrder order, boolean logInfoAsDebug)
This action submits an order against the CMF Risk Firewall using a fully initialised com.apama.oms.NewOrder event. |
void |
submitViaFirewallAgainstReservation(string firewallServiceId, string reservationId, com.apama.oms.NewOrder order, boolean logInfoAsDebug)
This action submits a order against the CMF Risk Firewall with the identifier of a corresponding Reservation 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 OrderPublisherStateContainer. The callback action provided will be called each time the order being published is updated.
void amend(float price, integer qty, dictionary<string, string > extraParams)This action requests an amend of the order that was submitted by the OrderPublisherStateContainer. Only the price, quantity and extra parameters may be changed on the order.
boolean canAmend(float price, integer qty, dictionary<string, string > extraParams)This action indicates whether or not the current order can be amended to the price, quantity and extraParams specified.
boolean canCancel(dictionary<string, string > extraParams)This action indicates whether or not the current order can be Cancelled.
void cancel()This action requests a Cancel of the order associated with this OrderPublisherStateContainer. In this variant of the cancel action, no extraParams are used in the cancel request.
void cancelWithExtraParams(dictionary<string, string > extraParams)This action requests a Cancel of the order associated with this OrderPublisherStateContainer. In this variant of the cancel action, the user can specify a set of extraParams to be used in the cancel request.
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.
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 getPubId()Returns the unique identifier of this instance of the OrderPublisherStateContainer.
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 removeUpdateListener(string name)Used to remove a registered update handler callback from the OrderPublisherStateContainer.
void submit(com.apama.oms.NewOrder order, boolean logInfoAsDebug)This action submits an order using a fully initialised com.apama.oms.NewOrder event.
void submitParallel(com.apama.oms.NewOrder order, boolean logInfoAsDebug, context destinationCtx)Establishes and initialises the order publisher. Establishes handlers for amend, cancel, update messages then runs the callbacks.
void submitParallelQuick(string symbol, string service, string market, string exchange, string type, string side, float price, integer quantity, boolean logInfoAsDebug, context destinationCtx)Used for direct submission without the need to create a NewOrder event.
void submitParallelQuickViaFirewall(string firewallServiceId, string symbol, string service, string market, string exchange, string type, string side, float price, integer quantity, boolean logInfoAsDebug, context destinationCtx)Used for direct submission without the need to create a NewOrder event.
void submitParallelQuickViaFirewallAgainstReservation(string firewallServiceId, string reservationId, string symbol, string service, string market, string exchange, string type, string side, float price, integer quantity, boolean logInfoAsDebug, context destinationCtx)Used for direct submission without the need to create a NewOrder event; uses reservation.
void submitParallelViaFirewall(string firewallServiceId, com.apama.oms.NewOrder order, boolean logInfoAsDebug, context destinationCtx)Used to submit an order via the firewall system.
void submitParallelViaFirewallAgainstReservation(string firewallServiceId, string reservationId, com.apama.oms.NewOrder order, boolean logInfoAsDebug, context destinationCtx)Used to submit an order via the firewall system.
void submitQuick(string symbol, string service, string market, string exchange, string type, string side, float price, integer quantity, boolean logInfoAsDebug)This action submits an order but only requires that a minimal set of parameters are provided.
void submitQuickViaFirewall(string firewallServiceId, string symbol, string service, string market, string exchange, string type, string side, float price, integer quantity, boolean logInfoAsDebug)This action submits an order against the CMF Risk Firewall, but only requires that a minimal set of parameters are provided.
void submitQuickViaFirewallAgainstReservation(string firewallServiceId, string reservationId, string symbol, string service, string market, string exchange, string type, string side, float price, integer quantity, boolean logInfoAsDebug)This action submits a order against the CMF Risk Firewall with the identifier of a corresponding Reservation order, but only requires that a minimal set of parameters are provided.
void submitViaFirewall(string firewallServiceId, com.apama.oms.NewOrder order, boolean logInfoAsDebug)This action submits an order against the CMF Risk Firewall using a fully initialised com.apama.oms.NewOrder event.
void submitViaFirewallAgainstReservation(string firewallServiceId, string reservationId, com.apama.oms.NewOrder order, boolean logInfoAsDebug)This action submits a order against the CMF Risk Firewall with the identifier of a corresponding Reservation order.
FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |