Read Live Algorithm

Orders

Introduction

Read out the orders of a live algorithm.

Request

Fetch the orders of a live algorithm for the project Id and steps provided. The /live/read/orders API accepts requests in the following format:

ReadLiveOrdersRequest Model - Request to read orders from a live algorithm.
start integer
Starting index of the orders to be fetched. Required if end > 100.
end integer
Last index of the orders to be fetched. Note that end - start must be less than 100.
projectId integer
Id of the project from which to read the live algorithm.
Example
{
  "start": 0,
  "end": 0,
  "projectId": 0
}

Responses

The /live/read/orders API provides a response in the following format:

200 Success

LiveOrdersResponse Model - Contains orders and the number of orders of the live algorithm in the request criteria.
orders Order object
/.
Length integer
Total number of returned orders.
latestOrderTimestamp integer
Timestamp of the latest order event.
Example
{
  "orders": {
    "Id": 0,
    "ContingentId": 0,
    "BrokerId": [
      "string"
    ],
    "Symbol": {
      "Value": "string",
      "ID": "string",
      "Permtick": "string"
    },
    "Price": 0,
    "PriceCurrency": "string",
    "Time": "2021-11-26T15:18:27.693Z",
    "CreatedTime": "2021-11-26T15:18:27.693Z",
    "LastFillTime": "2021-11-26T15:18:27.693Z",
    "LastUpdateTime": "2021-11-26T15:18:27.693Z",
    "CanceledTime": "2021-11-26T15:18:27.693Z",
    "Quantity": 0,
    "Type": "Market",
    "Status": "New",
    "Tag": "string",
    "SecurityType": "Base",
    "Direction": "Buy",
    "Value": 0,
    "OrderSubmissionData": {
      "BidPrice": 0,
      "AskPrice": 0,
      "LastPrice": 0
    },
    "IsMarketable": true
  },
  "Length": 0,
  "latestOrderTimestamp": 0
}
Order Model - Order struct for placing new trade.
Id integer
Order ID.
ContingentId integer
Order id to process before processing this order.
BrokerId string Array
Brokerage Id for this order for when the brokerage splits orders into multiple pieces.
Symbol Symbol object
Represents a unique security identifier. This is made of two components, the unique SID and the Value. The value is the current ticker symbol while the SID is constant over the life of a security.
Price number
Price of the Order.
PriceCurrency string
Currency for the order price.
Time string($date-time)
Gets the utc time the order was created.
CreatedTime string($date-time)
Gets the utc time this order was created. Alias for Time.
LastFillTime string($date-time)
Gets the utc time the last fill was received, or null if no fills have been received.
LastUpdateTime string($date-time)
Gets the utc time this order was last updated, or null if the order has not been updated.
CanceledTime string($date-time)
Gets the utc time this order was canceled, or null if the order was not canceled.
Quantity number
Number of shares to execute.
Type string Enum
Order type. Options : ['Market', 'Limit', 'StopMarket', 'StopLimit', 'MarketOnOpen', 'MarketOnClose', 'OptionExercise']
Status string Enum
Status of the Order. Options : ['New', 'Submitted', 'PartiallyFilled', 'Filled', 'Canceled', 'None', 'Invalid', 'CancelPending', 'UpdateSubmitted']
Tag string
Tag the order with some custom data.
SecurityType string Enum
Type of tradable security / underlying asset. Options : ['Base', 'Equity', 'Option', 'Commodity', 'Forex', 'Future', 'Cfd', 'Crypto']
Direction string Enum
Direction of the order. Options : ['Buy', 'Sell', 'Hold']
Value number
Gets the executed value of this order. If the order has not yet filled, then this will return zero.
OrderSubmissionData OrderSubmissionData object
Stores time and price information available at the time an order was submitted.
IsMarketable boolean
Returns true if the order is a marketable order.
Example
{
  "Id": 0,
  "ContingentId": 0,
  "BrokerId": [
    "string"
  ],
  "Symbol": {
    "Value": "string",
    "ID": "string",
    "Permtick": "string"
  },
  "Price": 0,
  "PriceCurrency": "string",
  "Time": "2021-11-26T15:18:27.693Z",
  "CreatedTime": "2021-11-26T15:18:27.693Z",
  "LastFillTime": "2021-11-26T15:18:27.693Z",
  "LastUpdateTime": "2021-11-26T15:18:27.693Z",
  "CanceledTime": "2021-11-26T15:18:27.693Z",
  "Quantity": 0,
  "Type": "Market",
  "Status": "New",
  "Tag": "string",
  "SecurityType": "Base",
  "Direction": "Buy",
  "Value": 0,
  "OrderSubmissionData": {
    "BidPrice": 0,
    "AskPrice": 0,
    "LastPrice": 0
  },
  "IsMarketable": true
}
Symbol Model - Represents a unique security identifier. This is made of two components, the unique SID and the Value. The value is the current ticker symbol while the SID is constant over the life of a security.
Value string
The current symbol for this ticker.
ID string
The security identifier for this symbol.
Permtick string
The current symbol for this ticker.
Example
{
  "Value": "string",
  "ID": "string",
  "Permtick": "string"
}
SecurityType Model - Type of tradable security / underlying asset.
SecurityType string Enum
Type of tradable security / underlying asset. Options : ['Base', 'Equity', 'Option', 'Commodity', 'Forex', 'Future', 'Cfd', 'Crypto']
Example
{
  "SecurityType": "Base"
}
OrderDirection Model - Direction of the order.
OrderDirection string Enum
Direction of the order. Options : ['Buy', 'Sell', 'Hold']
Example
{
  "OrderDirection": "Buy"
}
OrderSubmissionData Model - Stores time and price information available at the time an order was submitted.
BidPrice number
The bid price at an order submission time.
AskPrice number
The ask price at an order submission time.
LastPrice number
The current price at an order submission time.
Example
{
  "BidPrice": 0,
  "AskPrice": 0,
  "LastPrice": 0
}

401 Authentication Error

UnauthorizedError Model - Unauthorized response from the API. Key is missing, invalid, or timestamp is too old for hash.
www_authenticate string
Header

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: