GetOrderHistory
Category: User Permissions: Trading, AccountReadOnly Call Type: Synchronous
Returns a complete list of all orders, both open and executed, for a specific account on the specified Order Management System. The account named in the request must be associated with the calling user.
Request
Key | Value |
---|---|
OMSId | integer. The ID of the Order Management System where the orders were placed. |
AccountId | integer. The ID of the account whose orders will be returned |
clientOrderId | integer. The unique ID assigned by the client for a specific order |
originalOrderId | integer. The original ID of the order before any modifications |
originalClientOrderId | integer. The original client-assigned ID of the order before any modifications. |
userId | integer. The ID of the user requesting the order history. |
instrumentId | integer. The ID of the trading instrument (e.g., a specific cryptocurrency or stock) for which the order history is being retrieved. |
startTimestamp | long integer. Date and time at which to begin the orders history, in POSIX format. |
endTimestamp | long integer. Date and time at which to begin the orders history, in POSIX format.integer. The ending timestamp (in POSIX format, milliseconds since 1 January 1970) until which to retrieve the order history. |
depth | integer. The maximum number of orders to retrieve. |
startIndex | integer. The index from which to start retrieving the order history. |
Response
The call GetOrderHistory returns an array containing both buy-side and a sell-side orders for the named account. The call returns an empty array if there are no open orders for the account.
Key | Value |
---|---|
Side | string. The side of a trade. One of: 0 Buy 1 Sell 2 Short 3 Unknown (an error condition) |
OrderId | long integer. The ID of the open order. The OrderID is unique in each Order Management System. |
Price | real. The price at which the buy or sell has been ordered. |
Quantity | real. The quantity of the product to be bought or sold. |
DisplayQuantity | real. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
orderType | string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
ClientOrderId | long integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
OrderState | string. The current state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 Fully Executed. |
ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
OrigQuantity | real. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
QuantityExecuted | real. If the open order has been at least partially executed, this value shows the amount that has been executed. |
AvgPrice | real. The average executed price for the instrument in the order. |
CounterPartyId | integer. The ID of the other party in an off-market trade. |
ChangeReason | string. If the order has been changed, this string value holds the reason. One of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified |
OrigOrderId | integer. If the order has been changed, this is the ID of the original order. |
OrigClOrdId | integer. If the order has been changed, this is the ID of the original client order ID. |
EnteredBy | integer. The user ID of the person who entered the order. |
IsQuote | Boolean. If this order is a quote, the value for IsQuote is true, else false. |
InsideAsk | real. If this order is a quote, this value is the Inside Ask price. |
InsideAskSize | real. If this order is a quote, this value is the quantity of the Inside Ask quote. |
InsideBid | real. If this order is a quote, this value is the Inside Bid price. |
InsideBidSize | real. If this order is a quote, this value is the quantity of the Inside Bid quote. |
LastTradePrice | real. The last price that this instrument traded at. |
RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
IsLockedIn | Boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
CancelReason | string. If this order has been canceled, this string holds the cancelation reason. |
OMSId | integer. The ID of the Order Management System on which the order took place. |
Last updated