When an order gets filled, it should have its status moved to 'closed'.
updateOrders(portfolio, symbol, timespan, ordertype = NULL,
side = NULL, qtysign = NULL, orderset = NULL, oldstatus = "open",
newstatus, statustimestamp)
text name of the portfolio to associate the order book with
identfier of the instrument to find orders for. The name of any associated price objects (xts prices, usually OHLC) should match these
xts-style character timespan to be the period to find orders of the given status and ordertype
one of NULL, "market","limit","stoplimit" or "stoptrailing" default NULL
one of NULL, "long" or "short", default NULL
one of NULL, -1,0,1 ; could be useful when all qty's are reported as positive numbers and need to be identified other ways, default NULL
set a tag identifying the orderset
one of NULL, "open", "closed", "canceled", "revoked", or "replaced", default "open"
one of "open", "closed", "canceled", "revoked", or "replaced"
timestamp of a status update, will be blank when order is initiated
When an order is updated with a new order, the order status should change to 'replaced' with a StatusTime that is the same as the one for the new order. This could happen in the case of a traditional Cancel/Replace, because of a trailing stop, or in the case of a partial fill that needs to enter a replaced order for the remainder.
When a risk event or over-limit event happens, typically open orders will be 'revoked'. Possibly new orders will be added to close open positions. Many models will also want to run a process at the close of market that will cancel all open orders.
If orderset is passed to updateOrders, all orders with oldstatus for the orderset will be updated, regardless of their other parameters.
addOrder
getOrders
getOrderBook