FRAMES NO FRAMES | ||||||
| ||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |
There are a number of actions provided by the OrderReceiverStateContainer event object that allow you to query the current state of the order being monitored. 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.OrderReceiverStateContainer recv :=
new com.apama.oms.OrderReceiverStateContainer;
recv.receiveOrder(newOrder, false);
// Test if the order received was valid
if( recv.getQty() < 1000 ) then {
// Order was valid, so acknowledge the order and fill it
recv.acknowledge( integer.getUnique() );
recv.fill( recv.getPrice(), recv.getQuantity() );
} else {
// Order was invalid, reject it
recv.reject( "Order rejected! Quantity requested was more than 1000!" );
}
}
}
Action Summary | |
---|---|
string |
_toString()
Returns a formatted string of the current order state. |
void |
acknowledge(string marketOrderId)
This action acknowledges the order, which indicates that it is now in the market and eligible to be filled. |
boolean |
canModify()
This action indicates whether or not the order can be modified in its current state. |
boolean |
canReceive()
This action indicates whether the OrderReceiverStateContainer is in a state where it is able to handle a new order. |
void |
commitAmend(string reason)
This action is used to commit a previously applied amendment to an order. This means that the order will be in market with the new price and quantity. |
void |
commitCancel(string reason)
This action commits a cancel, removing the order from market. If userCancel was not called before this the cancellation is considered an external modification. |
void |
connectionDisconnected(string description)
This action can be used to reports that the receiver has lost connection to the publisher. If the order was in a modifiable state, it will set the order state to "unknown" and "externally modified", before committing a cancellation of the order. |
void |
externalAmend(float price, integer qty, dictionary<string, string > extraParams)
This action is used to an external amendment to an order (e.g. from the exchange side). This must be committed later using #commitAmend() for the amendment to take effect. |
void |
fill(float price, integer qty)
This action partially or fully fills an order at the price and quantity specified, and sends the result to the orders publisher. If the order has been fully filled, then the orders "final" flag is enabled. |
void |
fillAndCommitCancel(float price, integer qty, string reason)
This action partially fills an order at the price and quantity specified, and commits a cancellation of the remaining quantity. This can be used to report the last fill on a market order. |
void |
fillWithCounterparty(float price, integer qty, string counterparty)
This action partially or fully fills an order at the price and quantity specified, and sends the result to the orders publisher reporting the counterparty. |
void |
fillWithOptionalFinalise(float price, integer qty, boolean setFinalIfQtyRemaining0)
This action partially or fully fills an order at the price and quantity specified, and sends the result to the orders publisher. The orders "final" flag is optionally enabled when the order has been fully filled. |
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 |
getQtyExecuted()
Returns the quantity executed so far. |
integer |
getQtyRemaining()
Returns the remaining order quantity. |
integer |
getQuantity()
Returns the order quantity. |
integer |
getRecvId()
Returns the unique identifier of this instance of the OrderReceiverStateContainer. |
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 |
receiveOrder(com.apama.oms.NewOrder order, boolean logInfoAsDebug)
This action is used to initialise an instance of the OrderReceiverStateContainer, and enables com.apama.oms.OrderUpdate events to be sent when the state of the order changes. |
void |
receiveOrderAndSetUpdateFlag(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean produceUpdates)
This action is used to initialise an instance of the OrderReceiverStateContainer, but allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes. |
void |
receiveOrderAndSetUpdateFlagWithOutExtraParams(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean produceUpdates, boolean notStoreExtraParams)
This action is used to initialise an instance of the OrderReceiverStateContainer, but allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes. |
void |
receiveOrderParallel(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean produceUpdates, context outputContext)
This action is used to initialise an instance of the OrderReceiverStateContainer in a separate context and also allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes. |
void |
receiveOrderWithOutExtraParams(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean notStoreExtraParams)
This action is used to initialise an instance of the OrderReceiverStateContainer, and enables com.apama.oms.OrderUpdate events to be sent when the state of the order changes. |
void |
reject(string reason)
This action rejects the order with the reason provided. |
void |
rejectAmend(string reason)
This action is used to reject a users requested amendment. |
void |
rejectCancel(string reason)
This action should be called to rejects a user's cancel request. |
void |
routeState()
This action is used to send a new update to the orders publisher, unless the order has not been acknowledged or is not already in a final state. |
void |
sendUpdate(com.apama.oms.OrderUpdate updateTemplate)
This action causes an orders state to be updated based on the OrderUpdate provided, and the updated order state is then send to the orders publisher. |
void |
setExternallyModified(boolean externallyModified)
This action sets the externallyModified flag, which indicates whether or not the order has been modified externally by the market. |
void |
setExtraParams(dictionary<string, string > extraParams)
This action sets the extraParams for the order if it is in a modifiable state. |
void |
setModifiable(boolean modifiable)
This action sets the modifiable flag, which indicates whether or not the order can be modified in its current state. |
void |
setStateUnknown(boolean stateUnknown, string reason)
This action sets the order state to "unknown" or removes it from unknown state. |
void |
setStatusMessage(string message)
This action is used to override the status message on any action that may generate an OrderUpdate event. This will only take effect for the next order update that is sent, subsequent updates will not use this message. |
void |
setVisible(boolean isVisible)
This action sets the isVisible flag, which indicates whether or not the order is visible in the market or not. Non-visible orders may include those that are not yet acknowledged or dark pool orders. |
void |
userAmend(com.apama.oms.AmendOrder update)
This action is used to acknowledge that a users request to amend an order has been received. This must be committed later using #commitAmend() for the amendment to take effect. |
void |
userCancel(com.apama.oms.CancelOrder co)
This action is used to acknowledge that a users request to cancel an order has been received. This must be committed later using #commitCancel() for the cancel to take effect. |
Action Detail |
---|
string _toString()Returns a formatted string of the current order state.
void acknowledge(string marketOrderId)This action acknowledges the order, which indicates that it is now in the market and eligible to be filled.
boolean canModify()This action indicates whether or not the order can be modified in its current state.
boolean canReceive()This action indicates whether the OrderReceiverStateContainer is in a state where it is able to handle a new order.
void commitAmend(string reason)This action is used to commit a previously applied amendment to an order. This means that the order will be in market with the new price and quantity.
void commitCancel(string reason)This action commits a cancel, removing the order from market. If userCancel was not called before this the cancellation is considered an external modification.
void connectionDisconnected(string description)This action can be used to reports that the receiver has lost connection to the publisher. If the order was in a modifiable state, it will set the order state to "unknown" and "externally modified", before committing a cancellation of the order.
void externalAmend(float price, integer qty, dictionary<string, string > extraParams)This action is used to an external amendment to an order (e.g. from the exchange side). This must be committed later using #commitAmend() for the amendment to take effect.
void fill(float price, integer qty)This action partially or fully fills an order at the price and quantity specified, and sends the result to the orders publisher. If the order has been fully filled, then the orders "final" flag is enabled.
void fillAndCommitCancel(float price, integer qty, string reason)This action partially fills an order at the price and quantity specified, and commits a cancellation of the remaining quantity. This can be used to report the last fill on a market order.
void fillWithCounterparty(float price, integer qty, string counterparty)This action partially or fully fills an order at the price and quantity specified, and sends the result to the orders publisher reporting the counterparty.
void fillWithOptionalFinalise(float price, integer qty, boolean setFinalIfQtyRemaining0)This action partially or fully fills an order at the price and quantity specified, and sends the result to the orders publisher. The orders "final" flag is optionally enabled when the order has been fully filled.
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 getQtyExecuted()Returns the quantity executed so far.
integer getQtyRemaining()Returns the remaining order quantity.
integer getQuantity()Returns the order quantity.
integer getRecvId()Returns the unique identifier of this instance of the OrderReceiverStateContainer.
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 receiveOrder(com.apama.oms.NewOrder order, boolean logInfoAsDebug)This action is used to initialise an instance of the OrderReceiverStateContainer, and enables com.apama.oms.OrderUpdate events to be sent when the state of the order changes.
void receiveOrderAndSetUpdateFlag(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean produceUpdates)This action is used to initialise an instance of the OrderReceiverStateContainer, but allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes.
void receiveOrderAndSetUpdateFlagWithOutExtraParams(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean produceUpdates, boolean notStoreExtraParams)This action is used to initialise an instance of the OrderReceiverStateContainer, but allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes.
void receiveOrderParallel(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean produceUpdates, context outputContext)This action is used to initialise an instance of the OrderReceiverStateContainer in a separate context and also allows the caller to choose whether or not OrderUpdates should be sent when the state of the order changes.
void receiveOrderWithOutExtraParams(com.apama.oms.NewOrder order, boolean logInfoAsDebug, boolean notStoreExtraParams)This action is used to initialise an instance of the OrderReceiverStateContainer, and enables com.apama.oms.OrderUpdate events to be sent when the state of the order changes.
void reject(string reason)This action rejects the order with the reason provided.
void rejectAmend(string reason)This action is used to reject a users requested amendment.
void rejectCancel(string reason)This action should be called to rejects a user's cancel request.
void routeState()This action is used to send a new update to the orders publisher, unless the order has not been acknowledged or is not already in a final state.
void sendUpdate(com.apama.oms.OrderUpdate updateTemplate)This action causes an orders state to be updated based on the OrderUpdate provided, and the updated order state is then send to the orders publisher.
void setExternallyModified(boolean externallyModified)This action sets the externallyModified flag, which indicates whether or not the order has been modified externally by the market.
void setExtraParams(dictionary<string, string > extraParams)This action sets the extraParams for the order if it is in a modifiable state.
void setModifiable(boolean modifiable)This action sets the modifiable flag, which indicates whether or not the order can be modified in its current state.
void setStateUnknown(boolean stateUnknown, string reason)This action sets the order state to "unknown" or removes it from unknown state.
void setStatusMessage(string message)This action is used to override the status message on any action that may generate an OrderUpdate event. This will only take effect for the next order update that is sent, subsequent updates will not use this message.
void setVisible(boolean isVisible)This action sets the isVisible flag, which indicates whether or not the order is visible in the market or not. Non-visible orders may include those that are not yet acknowledged or dark pool orders.
void userAmend(com.apama.oms.AmendOrder update)This action is used to acknowledge that a users request to amend an order has been received. This must be committed later using #commitAmend() for the amendment to take effect.
void userCancel(com.apama.oms.CancelOrder co)This action is used to acknowledge that a users request to cancel an order has been received. This must be committed later using #commitCancel() for the cancel to take effect.
FRAMES NO FRAMES | ||||||
| ||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |