--- swagger: "2.0" info: title: Tradestation API description: | This document describes the resources that make up the official TradeStation API. If you have any problems or requests please contact [support](mailto:webapi@tradestation.com). Overview ======== The TradeStation API is reachable at the base-url: ``` https://api.tradestation.com/v2 ``` Current Version --------------- The latest version is 20160101, but currently we are in transition, so by default all requests receive the 20101026 version for backwards compatibility. Always explicitly request this version by adding the `APIVersion` querystring parameter as shown below: ``` https://api.tradestation.com/v2/data/quote/msft?APIVersion=20160101 ``` Note: This will ensure your application will not be broken when we deprecate the 20101026 version in favor of 20160101 or newer versions. SIM vs LIVE ----------- We also offer a Simulator(SIM) API for "Paper Trading" that is identical to the Live API in all ways except it uses fake trading accounts seeded with fake money and orders are not actually executed - only simulated executions occur with instant "fills". To access the SIM environment, you must change your base-url to: ``` https://sim-api.tradestation.com/v2 ``` **WARNING:** TradeStation is not liable for mistakes made by applications that allow users to switch between SIM and Live environments. ### Why offer a Simulator? Transactional API calls such as Order Execution offers users or applications the ability to experiment within a Simulated trading system so that real accounts and money are not affected and trades are not actually executed. Other potential use-cases: - Learning how to use applications via Paper Trading. - Exploring TradeStation API behavior without financial ramifications - Testing apps and websites before making them Live to customers - Enabling users to "Try-before-they-buy" with apps that use the TradeStation API - Hosting trading competitions or games HTTP Requests ------------- All API access is over HTTPS, and accessed from the https://api.tradestation.com. All data is sent and received as JSON, with some limited support for XML. Example Request: ``` curl -i https://api.tradestation.com/v2/data/quote/msft?APIVersion=20160101 HTTP/1.1 200 OK Cache-Control: private Content-Length: 1545 Content-Type: application/default+json; charset=utf-8 Access-Control-Allow-Origin: * APIVersion: 20160101 Date: Wed, 30 Nov 2016 01:51:45 GMT [ ...json... ] ``` ### Common Conventions - Blank fields may either be included as null or omitted, so please support both. - All timestamps are returned in [Epoch time](https://en.wikipedia.org/wiki/Unix_time) format unless stated otherwise. HTTP Streaming -------------- The TradeStation API offers HTTP Streaming responses for some specialized resources including intraday barcharts, quote changes, and quote snapshots. These streams conform to RFC2616 for HTTP/1.1 Streaming with some slight modifications. > The HTTP streaming mechanism keeps a request open indefinitely. It > never terminates the request or closes the connection, even after the > server pushes data to the client. This mechanism significantly > reduces the network latency because the client and the server do not > need to open and close the connection. > > The basic life cycle of an application using HTTP streaming is as > follows: > > 1. The client makes an initial request and then waits for a > response. > > 2. The server defers the response to a poll request until an update > is available, or until a particular status or timeout has > occurred. > > 3. Whenever an update is available, the server sends it back to the > client as a part of the response. > > 4. The data sent by the server does not terminate the request or the > connection. The server returns to step 3. > > The HTTP streaming mechanism is based on the capability of the server > to send several pieces of information in the same response, without > terminating the request or the connection. Source: [RFC6202, Page 7](https://tools.ietf.org/html/rfc6202#page-7). HTTP Streaming resources are identified under in this documentation as such, all other resources conform to the HTTP Request pattern instead. The HTTP Streaming response is returned with the following headers: ``` Transfer-Encoding: chunked Content-Type: application/vnd.tradestation.streams+json ``` Note: The `Content-Length` header is typically omitted since the response body size is unknown. Streams consist of a series of chunks that contain individual JSON objects to be parsed separately rather than as a whole response body. One unique thing about TradeStation's HTTP Streams is they also can terminate unlike a canonical HTTP/1.1 Stream. Streams terminate with a non-JSON string prefixed with one of the following: - `END` - `ERROR` In the case of `ERROR`, it will often be followed by an error message like: ``` ERROR - A Timeout Occurred after waiting 15000ms ``` In either case, the HTTP client must terminate the HTTP Stream and end the HTTP Request lifetime as a result of these messages. In the case of `ERROR` the client application may add a delay before re-requesting the HTTP Stream. ### How to handle HTTP Chunked Encoded Streams Healthy chunked-encoded streams emit variable length chunks that contain parsable JSON. For example: ``` GET https://sim.api.tradestation.com/v2/stream/barchart/$DJI/1/Minute/12-26-2016/01-24-2017 HTTP/1.1 200 OK Date: Wed, 14 Jun 2017 01:17:36 GMT Content-Type: application/vnd.tradestation.streams+json Transfer-Encoding: chunked Connection: keep-alive Access-Control-Allow-Origin: * Cache-Control: private 114 {"Close":19956.09,"DownTicks":26,"DownVolume":940229,"High":19961.77,"Low":19943.46,"Open":19943.46,"Status":13,"TimeStamp":"\/Date(1482849060000)\/","TotalTicks":59,"TotalVolume":3982533,"UnchangedTicks":0,"UnchangedVolume":0,"UpTicks":33,"UpVolume":3042304,"OpenInterest":0} 112 {"Close":19950.82,"DownTicks":32,"DownVolume":440577,"High":19959.15,"Low":19947.34,"Open":19955.64,"Status":13,"TimeStamp":"\/Date(1482849120000)\/","TotalTicks":60,"TotalVolume":761274,"UnchangedTicks":0,"UnchangedVolume":0,"UpTicks":28,"UpVolume":320697,"OpenInterest":0} END ``` Typically this will stream forever, unless a network interruption or service disruption occurs. It is up to the client to properly handle stream lifetime and connection closing. ### How to parse JSON chunks In order to process these chunks, API consumers should first read the response buffer, then de-chunk the plain-text strings, and finally identify new JSON objects by applying tokenizing techniques to the resulting text stream using either a streaming JSON parser, Regex, a lexer/parser, or brute-force string indexing logic. A simple but effective technique is after de-chunking to simply parse based upon the `\n` (newline character) delimiter written to the end of each JSON object. However, a more robust solution is less likely to break later. #### Variable Length JSON Chunking As a developer, be careful with how you parse HTTP Streams, because the API’s or intermediate proxies may chunk JSON objects many different ways. > Using HTTP streaming, several application > messages can be sent within a single HTTP response. The > separation of the response stream into application messages needs > to be performed at the application level and not at the HTTP > level. In particular, it is not possible to use the HTTP chunks > as application message delimiters, since intermediate proxies > might “re-chunk” the message stream (for example, by combining > different chunks into a longer one). This issue does not affect > the HTTP long polling technique, which provides a canonical > framing technique: each application message can be sent in a > different HTTP response. Source: [RFC6202, Section 3.2](https://tools.ietf.org/html/rfc6202#section-3.2) Translation: Be prepared for JSON objects that span chunks. You may see chunks with varying numbers of JSON objects, including: - "exactly 1" JSON object per chunk - “at least 1” JSON object per chunk - 1 JSON object split across 2 or more chunks Example of 2 JSON objects in 1 chunk: ``` GET https://sim.api.tradestation.com/v2/stream/barchart/$DJI/1/Minute/12-26-2016/01-24-2017 HTTP/1.1 200 OK Date: Wed, 14 Jun 2017 01:17:36 GMT Content-Type: application/vnd.tradestation.streams+json Transfer-Encoding: chunked Connection: keep-alive Access-Control-Allow-Origin: * Cache-Control: private 22d {"Close":19956.09,"DownTicks":26,"DownVolume":940229,"High":19961.77,"Low":19943.46,"Open":19943.46,"Status":13,"TimeStamp":"\/Date(1482849060000)\/","TotalTicks":59,"TotalVolume":3982533,"UnchangedTicks":0,"UnchangedVolume":0,"UpTicks":33,"UpVolume":3042304,"OpenInterest":0} {"Close":19950.82,"DownTicks":32,"DownVolume":440577,"High":19959.15,"Low":19947.34,"Open":19955.64,"Status":13,"TimeStamp":"\/Date(1482849120000)\/","TotalTicks":60,"TotalVolume":761274,"UnchangedTicks":0,"UnchangedVolume":0,"UpTicks":28,"UpVolume":320697,"OpenInterest":0} END ``` Example of 1 JSON objects split across 2 chunks: ``` GET https://sim.api.tradestation.com/v2/stream/barchart/$DJI/1/Minute/12-26-2016/01-24-2017 HTTP/1.1 200 OK Date: Wed, 14 Jun 2017 01:17:36 GMT Content-Type: application/vnd.tradestation.streams+json Transfer-Encoding: chunked Connection: keep-alive Access-Control-Allow-Origin: * Cache-Control: private 40 {"Close":71.65,"DownTicks":45,"DownVolume":5406,"High":71.67,"Lo C2 w":71.65,"Open":71.66,"Status":13,"TimeStamp":"\/Date(1497016260000)\/","TotalTicks":77,"TotalVolume":17270,"UnchangedTicks":0,"UnchangedVolume":0,"UpTicks":32,"UpVolume":11864,"OpenInterest":0} END ``` This is allowed by the HTTP/1.1 specification, but can be confusing or lead to bugs in client applications if you try to depend parsing JSON along the HTTP chunk-boundaries because even if it works during testing, later if users connect from a different network, it may change the chunking behavior. For example, if you are at a coffee shop with wifi which employs an HTTP Proxy, then it may buffer the stream and change the chunking boundary from 1 JSON object per chunk, to splitting each JSON object across 2 or 3. In fact, the HTTP/1.1 spec clearly advises developers of proxies to always “re-chunk” HTTP Streams, so this is almost a guarantee to happen in the wild. HTTP Streaming API consumers should be prepared to support all variations. Rate Limiting ------------- The TradeStation API Rate Limits on the number of requests a given user & client can make to the API in order to ensure fairness between users and prevent abuse to our network. Each API Key is allocated quota settings upon creation. These settings are applied on a per-user basis. If the quota is exceeded, an HTTP response of `403 Quota Exceeded` will be returned. Quotas are reset on a 5-minute interval based on when the user issued the first request. ## Resource Categories The rate limit applies to the following resource-categories: | Resource-Category | Quota | Interval | | --------------------------------------------- | ----- | -------- | | Accounts | 250 | 5-minute | | Order Details | 250 | 5-minute | | Balances | 250 | 5-minute | | Positions | 250 | 5-minute | | Data Quotes | 250 | 5-minute | | Quote Change Stream | 500 | 5-minute | | Quote Snapshot Stream | 500 | 5-minute | | Barchart Stream | 500 | 5-minute | | TickBar Stream | 500 | 5-minute | ## Intervals Quotas have "Windows" that last for a limited time interval (generally 5-minutes). Once the user has exceeded the maximum request count, all future requests will fail with a `403` error until the interval expires. Rate Limit intervals do not slide based upon the number of requests, they are fixed at a point in time starting from the very first request for that category of resource. After the interval expires, the cycle will start over at zero and the user can make more requests. ### Example A A user logs into the TradeStation WebAPI with your application and issues a request to `/v2/EliteTrader/accounts`. As a result, the request quota is incremented by one for the `Accounts` resource-category. The user then issues 250 more requests immediately to `/v2/EliteTrader/accounts`. The last request fails with `403 Quota Exceeded`. All subsequent requests continue to fail until the 5-minute interval expires from the time of the very first request. ### Example B A user logs into the TradeStation WebAPI with your application and issues a request to `/v2/data/quote/IBM,NFLX,MSFT,AMZN,AAPL`. As a result, the request quota is incremented by one for the `Data Quotes` resource-category. The user then immediately issues the same request 250 more times. The last request fails with `403 Quota Exceeded`. All subsequent requests continue to fail until the 5-minute interval expires from the time of the first request. **Example Throttled Request** ``` GET https://api.tradestation.com/v2/data/quotes/IBM,NFLX,MSFT,AMZN,AAPL HTTP/1.1 Host: api.tradestation.com Authorization: bearer eE45VkdQSnlBcmI0Q2RqTi82SFdMSVE0SXMyOFo5Z3dzVzdzdk Accept: application/json ``` **Example Failed Response** ``` HTTP/1.1 403 Quota Exceeded Content-Length: 15 Server: Microsoft-IIS/7.5 X-AspNet-Version: 4.0.30319 Date: Tue, 06 Dec 2011 20:50:32 GMT Quota Exceeded ``` # Parameters # ---------- # HTTP Errors # ----------- # HTTP Redirects # -------------- # HTTP Verbs # ---------- # REST Flavor # ----------- # Cross Origin Resoure Sharing # ---------------------------- # Timezones # --------- version: "20160101" x-logo: url: 'ts-logo.png' termsOfService: http://elasticbeanstalk-us-east-1-525856068889.s3.amazonaws.com/wp-content/uploads/2014/03/Guidelines_For_Acceptance.pdf contact: name: TradeStation API Team email: webapi@tradestation.com url: https://developer.tradestation.com/webapi license: name: Services Agreement For Application Developers url: https://s3.amazonaws.com/elasticbeanstalk-us-east-1-525856068889/wp-content/uploads/2016/02/Agreement-for-WebAPI-Developers_v5C.pdf ############################################################################## host: api.tradestation.com basePath: / schemes: - https consumes: - application/json; charset=utf-8 produces: - application/json; charset=utf-8 ############################################################################## securityDefinitions: OAuth2-Auth-Code: description: | The authorization code grant type is used to obtain both access tokens and refresh tokens and is optimized for confidential clients. Since this is a redirection-based flow, the client must be capable of interacting with the resource owner’s user-agent (typically a web browser) and capable of receiving incoming requests (via redirection) from the authorization server. #### Implementation Guide The authorization code grant type allows the end users to authenticate with TradeStation directly and authorize the Client application to make calls on their behalf. Access Tokens obtained via the authorization code Grant Type can be refreshed, they will expire in 20 minutes of the time issued. These access tokens are accepted in the HTTP `Authorization` header. **Step-by-Step** **1. Redirect user for authentication/authorization** The client application will route the end-user to our MFA (multi-factor authentication) login page web page. *Authorize Uri:* - https://api.tradestation.com/v2/authorize *Required query string parameters:* - redirect_uri - client_id = the client application’s API key - response_type = code *Example Authorization Page Url:* ``` https://api.tradestation.com/v2/authorize/?redirect_uri=https://exampleclientapp.com/authcode.aspx&client_id=D7635234&response_type=code ``` The URL will take you to a TradeStation login page. **2. Client receives authorization code** Upon successful authentication; The user agent(browser) will be redirected to the URL provided and include an Authorization Code in the query string. *Example Redirect:* ``` HTTP 301 Redirect RedirectURL = https://exampleclientapp.com/authcode.aspx?code=AFF345CD12B ``` *Note:* - This redirect URL can be anything that the user agent can understand. In the case of an embedded browser it could be a URL to a native view, i.e.: device://viewname - The Authorization Code is only valid for 30 seconds **3. Exchange Authorization Code for Access Token** The Client uses the Authorization Code to request an Access Token via the `/security/authorize` service method using the authorization_code grant type; *Required Header:* - Content-Type: application/x-www-form-urlencoded - Content-Length = Length of body information in UTF8 *Required form parameters:* - grant_type = authorization_code - client_id = The client application’s API key - redirect_uri = The redirect uri used when obtaining the Authorization Code being provided - code = The Authorization Code value - client_secret = The secret for the client application’s API Key *Example Request* ``` POST https://api.tradestation.com/v2/Security/Authorize HTTP/1.1 Content-Type: application/x-www-form-urlencoded Host: api.tradestation.com Content-Length: 630 grant_type=authorization_code&client_id=11111111-1111-1111-1111-111111111111&redirect_uri=test.aspx&client_secret=11111111-1111-1111-1111-111111111111&code=YjlkWDRqVmxlRXphaZzM1NWQ1MzZtVVFJQXFkcmk3eldOSjRUSDJHSklqN1dMNkk=&response_type=token ``` *Example Response* ``` HTTP/1.1 200 OK Cache-Control: private Content-Length: 927 Content-Type: application/json; charset=utf-8 Server: Microsoft-IIS/7.5 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Tue, 06 Dec 2011 20:50:32 GMT { "refresh_token": "eGlhc2xvTTVJaEdXMWs4VjhraWx4bk5QMHJMaA==", "expires_in": 1200, "access_token": "eGlhc2xvozT2IxWnVITmdwGVFPQ==", "token_type": "AccessToken", "userid": "testUser" } ``` type: oauth2 flow: accessCode authorizationUrl: "https://api.tradestation.com/v2/security/authorize" tokenUrl: "https://api.tradestation.com/v2/security/authorize" scopes: marketdata: | Requests access to lookup or stream Market Data readaccount: | Requests access to view Brokerage Accounts belonging to the End-User trade: | Requests access to execute orders on behalf of the End-User # news: | # Requests access to view Market News # hotlists: | # Requests access to be allowed to execute HotList symbol scans # grant_type=authorization_code&code=K29qbmpGSEFDMLS0c=&client_id=42545245&redirect_uri=/webapi/authorize/authcodetest.aspx&client_secret=2452345 OAuth2-Refresh-Token: description: | After an access token has expired or it becomes invalid, the Refresh token grant type can be used in order to obtain a new access token. Refresh tokens are valid indefinitely, unless the API key has been removed. A refresh token is specifically asigned for one API key and cannot be used to request new access tokens for a differet API key. *Required Header:* - Content-Type: application/x-www-form-urlencoded - Content-Length = Length of body information in UTF8 *Required form parameters:* - grant_type: "refresh_token" is the expected value for this grant type - client_id: The client application’s API key - refresh_token: The Refresh Token value generated when to original Access token was requested. - client_secret: The secret for the client application’s API Key - response_type: "token" is the expected value for the response type. *Example Request* ``` POST https://api.tradestation.com/v2/security/authorize HTTP/1.1 Content-Type: application/x-www-form-urlencoded Host: api.tradestation.com Content-Length: 630 grant_type=refresh_token&client_id=11111111-1111-1111-1111-111111111111&redirect_uri=http://www.myredirect.com&client_secret=11111111-1111-1111-1111-111111111111&refresh_token=YjlkWDRqVmxlRXphaZzM1NWQ1MzZtVdMNkk==&reponse_type=token ``` *Example Response* ``` HTTP/1.1 200 OK Cache-Control: private Content-Length: 927 Content-Type: application/json; charset=utf-8 Server: Microsoft-IIS/7.5 Date: Tue, 06 Dec 2011 20:50:32 GMT { "access_token":"VUdLbE1RbTdCRUE4==", "expires_in":1200, "token_type":"AccessToken", "userid":"testUser" } ``` *Possible Errors* - Invalid API Key: The API key sent as parameter does not match with the API key used to create the Refresh token. - API key failure: They API secret sent as parameter does not match with the API secret used to create the Refresh token. - Invalid refresh token: The refresh token used is not same that was sent to the user when the original access token was created. type: oauth2 flow: application tokenUrl: "https://api.tradestation.com/v2/security/authorize" scopes: marketdata: | Requests access to lookup or stream Market Data readaccount: | Requests access to view Brokerage Accounts belonging to the End-User trade: | Requests access to execute orders on behalf of the End-User # news: | # Requests access to view Market News # hotlists: | # Requests access to be allowed to execute HotList symbol scans # grant_type=refresh_token&client_id=123456&redirect_uri=http://www.myredirect.com&client_secret=789456&refresh_token=1234myRefreshToken56789 ############################################################################## tags: - name: marketdata description: | Snapshots and live streams of market data from supported exchanges. - name: brokerage description: | Access to bank accounts, order transactions, and market positions for the given user account. - name: order-execution description: | Trading tools for order submission, cancellation, and pre-order confirmation. ############################################################################## paths: '/v2/data/symbol/{symbol}': get: summary: | Get Symbol Info description: | Finds the given symbol and returns a collection of fields describing the symbol, its origin exchange, and other pertinant information. operationId: getSymbol tags: - marketdata parameters: - name: symbol in: path type: string description: Symbol to lookup required: true security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata x-code-samples: - lang: shell source: | curl -H "Authorization: Bearer 1JUjFiNFFGWEdDM" "https://api.tradestation.com/v2/data/symbol/AMZN" responses: '200': description: symbol response schema: $ref: '#/definitions/SymbolDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Symbol not found schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/data/symbols/suggest/{text}': get: summary: | Suggest Symbols description: | Suggests symbols semantically based upon partial input of symbol name, company name, or description operationId: suggestsymbols tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata x-code-samples: - lang: shell source: | curl -H "Authorization: Bearer 1JUjFiNFFGWEdDM" "https://api.tradestation.com/v2/data/symbols/suggest/A" parameters: - name: $top in: query type: integer description: The top number of results to return required: true - name: $filter in: query type: string description: An OData filter to apply to the results required: true - name: text in: path type: string description: Symbol text for suggestion required: true responses: '200': description: symbol suggest response schema: $ref: '#/definitions/SymbolSuggestDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/data/symbols/search/{criteria}': get: summary: | Search for Symbols description: | Searches symbols based upon input criteria including Name, Category and Country. operationId: searchSymbols tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata x-code-samples: - lang: shell source: | curl -H "Authorization: Bearer 1JUjFiNFFGWEdDM" "https://api.tradestation.com/v2/data/symbols/search?N=MSFT&C=Stock&Cnt=US" parameters: - name: criteria in: path type: string description: | Criteria are represented as Key/value pairs (`&` separated): `N`: Name of Symbol. (Optional) `C`: Asset categories. (Optional) Possible values: - `Future` or `FU` - `FutureOption` or `FO` - `Stock` or `S` (Default) - `StockOption` or `SO` (If root is specified, default category) - `Index` or `IDX` - `CurrencyOption` or `CO` - `MutualFund` or `MF` - `MoneyMarketFund` or `MMF` - `IndexOption` or `IO` - `Bond` or `B` - `Forex` or `FX` `Cnt`: Country where the symbol is traded in. (Optional) Possible values: - `ALL` if not presented (Default) - `US` - `DE` - `CA` #### For Equities Lookups: `N`: partial/full symbol name, will return all symbols that contain the provided name value `Desc`: Name of the company `Flg`: indicates whether symbols no longer trading should be included in the results returned. (Optional) This criteria is not returned in the symbol data. Possible values: - `true` - `false` (Default) `Cnt`: Country where the symbol is traded in. (Optional) Possible values: - `ALL` if not presented (Default) - `US` - `DE` - `CA` #### For Options Lookups: (Category=StockOption, IndexOption, FutureOption or CurrencyOption) `R`: Symbol root. Required field, the symbol the option is a derivative of, this search will not return options based on a partial root. `Stk`: Number of strikes prices above and below the underlying price - Default value 3 `Spl`: Strike price low `Sph`: Strike price high `Exd`: Number of expiration dates. - Default value 3 `Edl`: Expiration date low, ex: 01-05-2011 `Edh`: Expiration date high, ex: 01-20-2011 `OT`: Option type. Possible values: - `Both` (Default) - `Call` - `Put` `FT`: Future type for FutureOptions. Possible values: - `Electronic` (Default) - `Pit` `ST`: Symbol type: Possible values: - `Both` - `Composite` (Default) - `Regional` #### For Futures Lookups: (Category = Future) `Desc`: Description of symbol traded `R`: Symbol root future trades `FT`: Futures type. Possible values: - `None` - `PIT` - `Electronic` (Default) - `Combined` `Cur`: Currency. Possible values: - `All` - `USD` (Default) - `AUD` - `CAD` - `CHF` - `DKK` - `EUR` - `DBP` - `HKD` - `JPY` - `NOK` - `NZD` - `SEK` - `SGD` `Exp`: whether to include expired contracts - `false` (Default) - `true` `Cnt`: Country where the symbol is traded in. (Optional) Possible values: - `ALL` if not presented (Default) - `US` - `DE` - `CA` #### For Forex Lookups: `N`: partial/full symbol name. Use all or null for a list of all forex symbols `Desc`: Description Note: - The exchange returned for all forex searches will be `FX` - The country returned for all forex searches will be `FOREX` required: true responses: '200': description: symbol search response schema: $ref: '#/definitions/SymbolSearchDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Symbol not found schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/data/quote/{symbols}': get: summary: | Get Quote description: | Gets the latest Level 1 Quote for the given Symbol operationId: getQuotes tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata x-code-samples: - lang: shell source: | curl -H "Authorization: Bearer 1JUjFiNFFGWEdDM" "https://api.tradestation.com/v2/data/quote/AMZN" parameters: - name: symbols in: path description: 1 or more Symbol Names (comma-separated) type: array items: type: string collectionFormat: csv required: true responses: '200': description: Quote response schema: $ref: '#/definitions/QuoteDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Symbol not found schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/stream/quote/changes/{symbols}': get: summary: | Stream Quote Changes description: | Streams the latest Quote information for the given Symbols. The first chunk in the stream is a full quote snapshot - subsequent chunks only contain fields of the quote object that have changed since the last chunk. An invalid symbol name will result in a response of this form - {"Symbol":"BADEXAMPLESYMBOL","Error":"FAILED, EX_INVALID_SYMBOL"} If the user is not entitled for the symbol requested, response will be of this form - {"Symbol":"EXAMPLESYMBOL","Error":"FAILED, EX_NOT_ENTITLED"} operationId: streamQuotesChanges tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata x-code-samples: - lang: shell source: | curl -H "Accept: application/vnd.tradestation.streams+json" -H "Authorization: Bearer 1JUjFiNFFGWEdDM" "https://api.tradestation.com/v2/stream/quote/changes/AMZN" produces: - text/plain - application/vnd.tradestation.streams+json parameters: - name: symbols in: path description: 1 or more Symbol Names (comma-separated) type: array items: type: string collectionFormat: csv required: true - name: Transfer-Encoding in: header description: a header with the value of `Chunked` must be passed to streaming resources type: string enum: - Chunked required: true responses: '200': description: Quote Stream response schema: $ref: '#/definitions/QuoteDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Symbol not found schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/stream/quote/snapshots/{symbols}': get: summary: | Stream Quote Snapshots description: | Streams the latest Quote for the given Symbols. Each chunk is a full quote object. An invalid symbol name will result in a response of this form - {"Symbol":"BADSYMBOLEXAMPLE","Error":"FAILED, EX_INVALID_SYMBOL"} If the user is not entitled for the symbol requested, response will be of this form - {"Symbol":"EXAMPLESYMBOL","Error":"FAILED, EX_NOT_ENTITLED"} operationId: streamQuotesSnapshots tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata x-code-samples: - lang: shell source: | curl -H "Accept: application/vnd.tradestation.streams+json" -H "Authorization: Bearer 1JUjFiNFFGWEdDM" "https://api.tradestation.com/v2/stream/quote/snapshots/AMZN" produces: - text/plain - application/vnd.tradestation.streams+json parameters: - name: symbols in: path description: 1 or more Symbol Names (comma-separated) type: array items: type: string collectionFormat: csv required: true responses: '200': description: Quote Stream response schema: $ref: '#/definitions/QuoteDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Symbol not found schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/stream/barchart/{symbol}/{interval}/{unit}/{startDate}': get: summary: | Stream BarChart - Starting on Date description: | Streams barchart data starting from startDate, each bar filling quantity of unit. operationId: streamBarchartsFromStartDate tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata x-code-samples: - lang: shell source: | curl -H "Accept: application/vnd.tradestation.streams+json" -H "Authorization: Bearer 1JUjFiNFFGWEdDM" "https://api.tradestation.com/v2/stream/barchart/AMZN/5/Minute/12-01-2016?SessionTemplate=USEQPreAndPost" produces: - text/plain - application/vnd.tradestation.streams+json parameters: - name: SessionTemplate in: query description: 'United States (US) stock market session templates, that extend bars returned to include those outside of the regular trading session. Ignored for non-US equity symbols.' type: string enum: - USEQPre - USEQPost - USEQPreAndPost - Default required: false - name: symbol in: path description: A Symbol Name type: string required: true - name: interval in: path description: 'Interval that each bar will consist of. **For Daily, Weekly, and Monthly units this value must be 1.**' type: integer minimum: 1 maximum: 1440 required: true - name: unit in: path description: Unit of time for each bar interval. type: string enum: - Minute - Daily - Weekly - Monthly required: true - name: startDate in: path description: 'The starting date to begin streaming bars from. Date is of form MM-DD-YYYY, and optionally can specify a starting time with format MM-DD-YYYYt08:00:00 and even further UTC offset with format MM-DD-YYYYt12:00:00-0600' type: string required: true responses: '200': description: Barchart response schema: $ref: '#/definitions/BarchartDefinition' '400': description: Bad Request schema: $ref: '#/definitions/BarchartError400' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Symbol not found schema: $ref: '#/definitions/BarchartError404' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/stream/barchart/{symbol}/{interval}/{unit}/{startDate}/{endDate}': get: summary: | Stream BarChart - Date Range description: | Streams barchart data starting from startDate to end date, each bar filling interval of unit. operationId: streamBarchartsFromStartDateToEndDate tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata x-code-samples: - lang: shell source: | curl -H "Accept: application/vnd.tradestation.streams+json" -H "Authorization: Bearer 1JUjFiNFFGWEdDM" "https://api.tradestation.com/v2/stream/barchart/AMZN/5/Minute/12-01-2016/12-16-2016?SessionTemplate=USEQPreAndPost" produces: - text/plain - application/vnd.tradestation.streams+json parameters: - name: SessionTemplate in: query description: 'United States (US) stock market session templates, that extend bars returned to include those outside of the regular trading session. Ignored for non-US equity symbols.' type: string enum: - USEQPre - USEQPost - USEQPreAndPost - Default required: false - name: symbol in: path description: A Symbol Name type: string required: true - name: interval in: path description: 'Interval that each bar will consist of. **For Daily, Weekly, and Monthly units this value must be 1.**' type: integer minimum: 1 maximum: 1440 required: true - name: unit in: path description: Unit of time for each bar interval. type: string enum: - Minute - Daily - Weekly - Monthly required: true - name: startDate in: path description: 'The starting date to begin streaming bars from. Date is of form MM-DD-YYYY, and optionally can specify a starting time with format MM-DD-YYYYt08:00:00 and even further UTC offset with format MM-DD-YYYYt12:00:00-0600' type: string required: true - name: endDate in: path description: 'The ending date for bars streamed. Date is of form MM-DD-YYYY, and optionally can specify a starting time with format MM-DD-YYYYt08:00:00 and even further UTC offset with format MM-DD-YYYYt12:00:00-0600' type: string required: true responses: '200': description: Barchart response schema: $ref: '#/definitions/BarchartDefinition' '400': description: Bad Request schema: $ref: '#/definitions/BarchartError400' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Symbol not found schema: $ref: '#/definitions/BarchartError404' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/stream/barchart/{symbol}/{interval}/{unit}/{barsBack}/{lastDate}/...': get: summary: | Stream BarChart - Bars Back description: | Streams barchart data starting from a number of bars back from last date, each bar filling interval of unit. operationId: streamBarchartsBarsBack tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata x-code-samples: - lang: shell source: | curl -H "Accept: application/vnd.tradestation.streams+json" -H "Authorization: Bearer 1JUjFiNFFGWEdDM" "https://api.tradestation.com/v2/stream/barchart/AMZN/5/Minute/25/12-01-2016?SessionTemplate=USEQPreAndPost" produces: - text/plain - application/vnd.tradestation.streams+json parameters: - name: SessionTemplate in: query description: 'United States (US) stock market session templates, that extend bars returned to include those outside of the regular trading session. Ignored for non-US equity symbols.' type: string enum: - USEQPre - USEQPost - USEQPreAndPost - Default required: false - name: symbol in: path description: A Symbol Name type: string required: true - name: interval in: path description: 'Interval that each bar will consist of. **For Daily, Weekly, and Monthly units this value must be 1.**' type: integer minimum: 1 maximum: 1440 required: true - name: unit in: path description: Unit of time for each bar interval. type: string enum: - Minute - Daily - Weekly - Monthly required: true - name: barsBack in: path description: 'The number of bars to stream, going back from time 00:00:00 of the day specified in lastDate' type: integer minimum: 1 maximum: 57600 required: true - name: lastDate in: path description: 'The date to use as the end point when getting bars back. Date is of form MM-DD-YYYY, and is for time 00:00:00 of that day.' type: string required: true responses: '200': description: Barchart response schema: $ref: '#/definitions/BarchartDefinition' '400': description: Bad Request schema: $ref: '#/definitions/BarchartError400' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Symbol not found schema: $ref: '#/definitions/BarchartError404' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/stream/barchart/{symbol}/{interval}/{unit}': get: summary: | Stream BarChart - Days Back description: | Streams barchart data starting from a number of days back from last date, each bar filling interval of unit. operationId: streamBarchartsDaysBack tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata x-code-samples: - lang: shell source: | curl -H "Accept: application/vnd.tradestation.streams+json" -H "Authorization: Bearer 1JUjFiNFFGWEdDM" "https://api.tradestation.com/v2/stream/barchart/AMZN/5/Minute?SessionTemplate=USEQPreAndPost&daysBack=1&lastDate=12-01-2016" produces: - text/plain - application/vnd.tradestation.streams+json parameters: - name: SessionTemplate in: query description: 'United States (US) stock market session templates, that extend bars returned to include those outside of the regular trading session. Ignored for non-US equity symbols.' type: string enum: - USEQPre - USEQPost - USEQPreAndPost - Default required: false - name: symbol in: path description: A Symbol Name type: string required: true - name: interval in: path description: 'Interval that each bar will consist of. **For Daily, Weekly, and Monthly units this value must be 1.**' type: integer minimum: 1 maximum: 1440 required: true - name: unit in: path description: Unit of time for each bar interval. type: string enum: - Minute - Daily - Weekly - Monthly required: true - name: daysBack in: query description: 'The number of bars to stream, going back from time 00:00:00 of the day specified in lastDate. Cannot exceed greater than 57600 if unit is Minute.' type: integer minimum: 1 required: true - name: lastDate in: query description: 'The date to use as the end point when getting days back. Date is of form MM-DD-YYYY, and optionally can specify a starting time with format MM-DD-YYYYt08:00:00 and even further UTC offset with format MM-DD-YYYYt12:00:00-0600' type: string required: false responses: '200': description: Barchart response schema: $ref: '#/definitions/BarchartDefinition' '400': description: Bad Request schema: $ref: '#/definitions/BarchartError400' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Symbol not found schema: $ref: '#/definitions/BarchartError404' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/stream/tickbars/{symbol}/{interval}/{barsBack}': get: summary: | Stream Tick Bars description: | Streams tick bars data from a number of bars back, each bar returned separated by interval number of ticks. operationId: streamTickBars tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata x-code-samples: - lang: shell source: | curl -H "Accept: application/vnd.tradestation.streams+json" -H "Authorization: Bearer 1JUjFiNFFGWEdDM" "https://api.tradestation.com/v2/stream/tickbars/AMZN/5/10?SessionTemplate=USEQPreAndPost" produces: - text/plain - application/vnd.tradestation.streams+json parameters: - name: symbol in: path description: A Symbol Name type: string required: true - name: interval in: path description: Interval for each bar returned (in ticks) type: integer minimum: 1 maximum: 64999 required: true - name: barsBack in: path description: 'The number of bars to stream, going back from current time' type: integer minimum: 1 maximum: 10 required: true responses: '200': description: Tickbar response schema: $ref: '#/definitions/TickbarDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Symbol not found schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ################################################################################ '/v2/data/symbollists': get: summary: | Get all Symbol Lists description: | Gets a list of all Symbol Lists operationId: getSymbolLists tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata x-code-samples: - lang: shell source: | curl -H "Authorization: Bearer 1JUjFiNFFGWEdDM" "https://api.tradestation.com/v2/data/symbollists" responses: '200': description: SymbolLists response schema: $ref: '#/definitions/SymbolListsDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/data/symbollists/{symbol_list_id}': get: summary: | Get Symbol List description: | Gets a specific Symbol List operationId: getSymbolListByID tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata parameters: - name: symbol_list_id in: path description: A valid Symbol List ID type: string required: true responses: '200': description: SymbolList response schema: $ref: '#/definitions/SymbolListDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Symbol List not found schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/data/symbollists/{symbol_list_id}/symbols': get: summary: | Get Symbols in a Symbol List description: | Gets the Symbols for a specific Symbol List operationId: getSymbolListSymbolsByID tags: - marketdata security: - OAuth2-Auth-Code: - marketdata - OAuth2-Refresh-Token: - marketdata parameters: - name: symbol_list_id in: path description: A valid Symbol List ID type: string required: true responses: '200': description: SymbolList Symbols response schema: $ref: '#/definitions/SymbolListSymbolsDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Symbol List not found schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/users/{user_id}/accounts': get: summary: | Get User Accounts description: | Returns all accounts for the given user operationId: getAccountsByUserID tags: - brokerage security: - OAuth2-Auth-Code: - readaccount - OAuth2-Refresh-Token: - readaccount parameters: - name: user_id in: path type: string description: User ID for Accounts Lookup required: true responses: '200': description: Accounts Response schema: $ref: '#/definitions/UserAccountsDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: User not found schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## ############################################################################## '/v2/accounts/{account_keys}/balances': get: summary: | Get Account Balances description: | Returns the Balance for the given accounts operationId: getBalancesByAccounts tags: - brokerage security: - OAuth2-Auth-Code: - readaccount - OAuth2-Refresh-Token: - readaccount parameters: - name: account_keys in: path description: '1 to 25 account keys can be specified, comma separated. Recommended batch size is 10.' type: array items: type: string required: true responses: '200': description: Account Balances Response schema: $ref: '#/definitions/AccountBalancesDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Account not found schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/accounts/{account_keys}/positions': get: summary: | Get Account Positions description: | Returns the Positions for the given accounts operationId: getPositionsByAccounts tags: - brokerage security: - OAuth2-Auth-Code: - readaccount - OAuth2-Refresh-Token: - readaccount parameters: - name: account_keys in: path description: '1 to 25 account keys can be specified, comma separated. Recommended batch size is 10.' type: array items: type: string required: true - name: $filter in: query type: string description: | An OData v2.0 filter. Available Fields: - `Symbol`: Symbol Name for Position responses: '200': description: Account Positions Response schema: $ref: '#/definitions/AccountPositionsDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Account not found schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/accounts/{account_keys}/orders': get: summary: | Get Account Orders description: | Returns the Orders for the given accounts sorted descending, most recent order first. Note: Intermediate order state changes are not available. operationId: getOrdersByAccounts tags: - brokerage security: - OAuth2-Auth-Code: - readaccount - OAuth2-Refresh-Token: - readaccount parameters: - name: since in: query type: string description: | Start Date from which to pull older orders. `MM-DD-YYYY` format. Limited to 14 days prior to the current date. required: false - name: account_keys in: path description: '1 to 25 account keys can be specified, comma separated. Recommended batch size is 10.' type: array items: type: string required: true - name: pageSize in: query type: string description: | Conveys the number of order items to return in the request. (Default page size is 600). Note that an empty set will be returned for a pageNum/pageSize combination that doesn't contain orders. Pagination applies to current and historical orders separately when a value for "since" is specified. required: false - name: pageNum in: query type: string description: | Conveys the page number to return, given a set of orders and a page size. Note that an empty set will be returned for a pageNum/pageSize combination that doesn't contain orders. required: false responses: '200': description: | Account Orders Response schema: $ref: '#/definitions/AccountOrdersDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '404': description: Account not found schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/orders/confirm': post: summary: | Confirm Order description: | Returns estimated cost and commission information for an order without the order actually being placed. Request valid for Market, Limit, Stop Market, Stop Limit, Options and Order Sends Order (OSO) order types. The fields that are returned in the response depend on the order type. The following shows the different fields that will be returned. **Base Confirmation** (All confirmations will have these fields) * Route * Duration * Account * SummaryMessage * OrderConfirmId **Equity Confirmation** (Base Confirmation fields + the following) * EstimatedPrice * EstimatedPriceDisplay * EstimatedCost * EstimatedCostDisplay * EstimatedCommission * EstimatedCommissionDisplay * DebitCreditEstimatedCost * DebitCreditEstimatedCostDisplay **Forex Confirmation** (Base Confirmation fields + the following) * BaseCurrency * CounterCurrency * InitialMarginDisplay **Futures Confirmation** (Base Confirmation fields + the following) * ProductCurrency * AccountCurrency * EstimatedCost * EstimatedPrice * EstimatedPriceDisplay * InitialMarginDisplay * EstimatedCommission * EstimatedCommissionDisplay operationId: postOrderConfirm tags: - order-execution security: - OAuth2-Auth-Code: - trade - OAuth2-Refresh-Token: - trade parameters: - name: body in: body required: true schema: $ref: '#/definitions/OrderConfirmRequestDefinition' responses: '200': description: Order Confirm Response schema: $ref: '#/definitions/OrderConfirmResponseDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/orders': post: summary: | Submit Order description: | Submits 1 or more orders. Request valid for Market, Limit, Stop Market, Stop Limit, Options and Order Sends Order (OSO) order types. operationId: postOrder tags: - order-execution security: - OAuth2-Auth-Code: - trade - OAuth2-Refresh-Token: - trade parameters: - name: body in: body required: true schema: $ref: '#/definitions/OrderRequestDefinition' responses: '200': description: Orders Response schema: $ref: '#/definitions/OrderResponseDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/orders/{order_id}': delete: summary: | Cancel Order description: | Cancels an open order. You cannot cancel an order that has been filled. operationId: cancelOrder tags: - order-execution security: - OAuth2-Auth-Code: - trade - OAuth2-Refresh-Token: - trade parameters: - name: order_id in: path type: string description: An existing Order ID required: true responses: '200': description: Cancel Order Response schema: $ref: '#/definitions/OrderResponseDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' put: summary: | Update Order description: | Updates (Cancels & Replaces) an open order. You cannot update an order that has been filled. Rules: | Original order type | Fields to update | Can only change order type to | | -------------------------------- | -------------------------------- | ----------------------------- | | Limit Orders | Quantity, Stop Price | Market | | Stop Orders | Quantity, Stop Price | Market | | Stop Limit Orders | Quantity, Stop Price, Stop Limit | Market | | Stop Market Trailing Stop Orders | Quantity | Market | | Trailing Stop Orders | Offset type and value | Market | operationId: cancelReplaceOrder tags: - order-execution parameters: - name: order_id in: path type: string description: An existing Order ID required: true - name: body in: body required: true schema: $ref: '#/definitions/CancelReplaceDefinition' responses: '200': description: CancelReplace Order Response schema: $ref: '#/definitions/OrderResponseDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/orders/groups/confirm': post: summary: | Confirm Group Order description: | Returns estimated cost and commission information for a group of orders (OCO, BRK) without the orders actually being placed **Base Confirmation** (All confirmations will have these fields) * Route * Duration * Account * SummaryMessage * OrderConfirmId **Equity Confirmation** (Base Confirmation fields + the following) * EstimatedPrice * EstimatedPriceDisplay * EstimatedCost * EstimatedCostDisplay * EstimatedCommission * EstimatedCommissionDisplay **Forex Confirmation** (Base Confirmation fields + the following) * BaseCurrency * CounterCurrency * InitialMarginDisplay **Futures Confirmation** (Base Confirmation fields + the following) * ProductCurrency * AccountCurrency * EstimatedCost * EstimatedPrice * EstimatedPriceDisplay * InitialMarginDisplay * EstimatedCommission * EstimatedCommissionDisplay operationId: postOrderGroupsConfirm tags: - order-execution security: - OAuth2-Auth-Code: - trade - OAuth2-Refresh-Token: - trade parameters: - name: body in: body required: true schema: $ref: '#/definitions/GroupOrderConfirmRequestDefinition' responses: '200': description: Group Order Confirm Response schema: $ref: '#/definitions/GroupOrderConfirmResponseDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/orders/groups': post: summary: | Submit Group Order description: | Submits a group order such as Bracket and OCO Orders. #### Order Cancels Order (OCO) An OCO order is a group of orders whereby if one of the orders is filled or partially-filled, then all of the other orders in the group are cancelled. #### Bracket OCO Orders A bracket order is a special instance of an OCO (Order Cancel Order). Bracket orders are used to exit an existing position. They are designed to limit loss and lock in profit by “bracketing” an order with a simultaneous stop and limit order. Bracket orders are limited so that the orders are all for the same symbol and are on the same side of the market (either all to sell or all to cover), and they are restricted to closing transactions. The reason that they follow these rules is because the orders need to be able to auto decrement when a partial fill occurs with one of the orders. For example, if the customer has a sell limit order for 1000 shares and a sell stop order for 1000 shares, and the limit order is partially filled for 500 shares, then the customer would want the stop to remain open, but it should automatically decrement the order to 500 shares to match the remaining open position. ### Errors When a submitted order fails, it can be seen in two different ways: - Immediately rejected during submit to the Orders API with a 400 HTTP status code. - Accepted by the API with a 200 HTTP status code, but you will see the order with a status of “REJ” (rejected) when you fetch the Order from the /v2/accounts/{id}/orders API #### NOTE When a group order is submitted, the order execution system treats each sibling order as an individual order. Thus, the system does not validate that each order has the same Quantity, and currently it is not able to update a bracket order as one transaction, instead you must update each order within a bracket. In order to prevent errors, please validate the data on the client side. operationId: postOrderGroup tags: - order-execution security: - OAuth2-Auth-Code: - trade - OAuth2-Refresh-Token: - trade parameters: - name: body in: body required: true schema: $ref: '#/definitions/GroupOrderRequestDefinition' responses: '200': description: Group Orders Response schema: $ref: '#/definitions/GroupOrderResponseDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/orderexecution/activationtriggers': get: summary: | Request Available Activation Triggers description: | To place orders with activation triggers, a valid TriggerKey must be sent with the order. This resource provides the available trigger methods with their corresponding key. operationId: getActivationTriggers tags: - order-execution security: - OAuth2-Auth-Code: - trade - OAuth2-Refresh-Token: - trade responses: '200': description: Get Activation Triggers Response schema: type: object properties: ActivationTriggers: type: array items: $ref: '#/definitions/ActivationTriggerDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## '/v2/orderexecution/exchanges': get: summary: | Request Available Exchanges description: | Returns a list of valid exchanges that a client can specify when posting an order. operationId: getExchanges tags: - order-execution responses: '200': description: Get Exchange List schema: type: object properties: Exchange: type: array items: $ref: '#/definitions/ExchangeDefinition' '400': description: Bad Request schema: $ref: '#/definitions/Error' '401': description: Unauthorized schema: $ref: '#/definitions/Error' '403': description: Forbidden schema: $ref: '#/definitions/Error' '500': description: Unexpected Error schema: $ref: '#/definitions/Error' '502': description: Bad Gateway schema: $ref: '#/definitions/Error' '504': description: Gateway Timeout schema: $ref: '#/definitions/Error' ############################################################################## definitions: Error: required: - StatusCode - Message properties: TraceId: type: string format: uuid StatusCode: type: integer format: int32 Message: type: string type: object BarchartError400: required: - StatusCode - Message properties: StatusCode: type: integer format: int32 Message: type: string enum: - Not a valid date. - Not a valid number. BarchartError404: required: - StatusCode - Message properties: StatusCode: type: integer format: int32 Message: type: string enum: - INVALID SYMBOL - Invalid bar interval quantity. - Invalid bar interval unit. - Invalid start date. - Invalid end date. - Start date can not be earlier than 1/1/1900 - End date cannot be earlier than start date. ############################################################################## SymbolDefinition: description: Symbol metadata properties: Category: minLength: 1 type: string description: 'The type of financial instrument that the symbol represents, such as a stock, index, or mutual fund.' Country: type: string description: The country of the exchange where the symbol is listed. enum: - US - DE - CA Currency: minLength: 1 type: string description: Displays the type of base currency for the selected symbol. enum: - USD - AUD - CAD - CHF - DKK - EUR - DBP - HKD - JPY - NOK - NZD - SEK - SGD Description: minLength: 1 type: string description: Displays the full name of the symbol. DisplayType: type: number description: | Symbol's price display type based on the following list: * `0` "Automatic" Not used * `1` 0 Decimals => 1 * `2` 1 Decimals => .1 * `3` 2 Decimals => .01 * `4` 3 Decimals => .001 * `5` 4 Decimals => .0001 * `6` 5 Decimals => .00001 * `7` Simplest Fraction * `8` 1/2-Halves => .5 * `9` 1/4-Fourths => .25 * `10` 1/8-Eights => .125 * `11` 1/16-Sixteenths => .0625 * `12` 1/32-ThirtySeconds => .03125 * `13` 1/64-SixtyFourths => .015625 * `14` 1/128-OneTwentyEigths => .0078125 * `15` 1/256-TwoFiftySixths => .003906250 * `16` 10ths and Quarters => .025 * `17` 32nds and Halves => .015625 * `18` 32nds and Quarters => .0078125 * `19` 32nds and Eights => .00390625 * `20` 32nds and Tenths => .003125 * `21` 64ths and Halves => .0078125 * `22` 64ths and Tenths => .0015625 * `23` 6 Decimals => .000001 Error: type: string description: Element that references error. Exchange: minLength: 1 type: string description: Name of exchange where this symbol is traded in. enum: - NYSE - NASDAQ - OTC - OTCBB AMEX - ARCX - NASDS - EUREX - ICE - CME - ONCH - NYMEX - CBOT ExchangeID: type: number description: A unique numerical identifier for the Exchange. ExpirationDate: minLength: 1 type: string description: Displays the expiration date for a futures or options contract in UTC formatted time. ExpirationType: type: string description: | For options only. It indicates whether the option is a monthly, weekly, quarterly or end of month expiration. * W - Weekly * M - Monthly * Q - Quartely * E - End of the month * "" - The term not be identified FutureType: minLength: 1 type: string description: Displays the type of future contract the symbol represents IndustryCode: type: string description: (Japan Only) Displays a digit code that categorize companies by the type of business activities they engage in. IndustryName: type: string description: '(Japan Only) Displays the Reuters assigned industry name to which the equity symbol belongs.' # Pending to be documented. It's comment-out due to information not available when descriptions were added to fields. #IsPreferredExchange: # type: boolean # description: '(Japan Only)' LotSize: type: number description: (Japan Only) The currency amount associated with a lot (contract) in the specified account. MinMove: type: number description: 'Multiplying factor using the display type to determine the minimum price increment the asset trades in. For options the MinMove may vary. If the MinMove is negative, then the MinMove is dependent on the price. The whole number portion of the min move is the threshold. The leftmost two digits to the right of the decimal (X.XXXX) indicate the min move beneath the threshold, and the rightmost two digits (X.XXXX) indicate the min move above the threshold.' Name: minLength: 1 type: string description: A unique series of letters assigned to a security for trading purposes. OptionType: minLength: 1 type: string description: 'Displays the type of options contract the symbol represents. Valid options include: Puts, Calls.' PointValue: type: number description: Symbol`s point value. Root: minLength: 1 type: string description: 'Displays the symbol of the stock on the stock exchange.' # Pending to be documented. It's comment-out due to the information was not available when descriptions were added to fields. #SectionClassCode: # type: string # description: '(Japan Only)' # Pending to be documented. It's comment-out due to the information was not available when descriptions were added to fields. #SectionClassName: # type: string # description: '(Japan Only)' SectorName: type: string description: (Japan Only) Displays the assigned economic sector to which the equity symbol belongs. StrikePrice: type: number description: Displays strike price of an options contract; For Options symbols only. Underlying: type: string description: The financial instrument on which an option contract is based or derived. required: - Category - Currency - Description - DisplayType - Exchange - ExchangeID - ExpirationDate - FutureType - LotSize - MinMove - Name - OptionType - PointValue - Root - StrikePrice - Underlying type: object ############################################################################## SymbolSuggestDefinition: description: '' items: properties: Category: minLength: 1 type: string description: 'The type of financial instrument that the symbol represents, such as a stock, index, or mutual fund.' Country: minLength: 1 type: string description: The country of the exchange where the symbol is listed. enum: - US - DE - CA Currency: minLength: 1 type: string description: Displays the type of base currency for the selected symbol. enum: - USD - AUD - CAD - CHF - DKK - EUR - DBP - HKD - JPY - NOK - NZD - SEK - SGD Description: minLength: 1 type: string description: Displays the full name of the symbol. Error: type: string description: Element that references error. Exchange: minLength: 1 type: string description: Name of exchange where this symbol is traded in. ExchangeID: type: number description: A unique numerical identifier for the Exchange. ExpirationDate: minLength: 1 type: string description: Displays the expiration date for a futures or options contract in UTC formatted time. ExpirationType: type: string description: | For options only. It indicates whether the option is a monthly, weekly, quarterly or end of month expiration. * W - Weekly * M - Monthly * Q - Quartely * E - End of the month * "" - The term not be identified FutureType: minLength: 1 type: string description: Displays the type of future contract the symbol represents. IndustryCode: type: string description: (Japan Only) Displays a digit code that categorize companies by the type of business activities they engage in. IndustryName: type: string description: '(Japan Only) Displays the Reuters assigned industry name to which the equity symbol belongs.' # Pending to be documented. It's comment-out due to the information was not available when descriptions were added to fields. #IsPreferredExchange: # type: boolean # description: '(Japan Only)' LotSize: type: number description: (Japan Only) The currency amount associated with a lot (contract) in the specified account. MinMove: type: number description: 'Multiplying factor using the display type to determine the minimum price increment the asset trades in. For options the MinMove may vary. If the MinMove is negative, then the MinMove is dependent on the price. The whole number portion of the min move is the threshold. The leftmost two digits to the right of the decimal (X.XXXX) indicate the min move beneath the threshold, and the rightmost two digits (X.XXXX) indicate the min move above the threshold.' Name: minLength: 1 type: string description: A unique series of letters assigned to a security for trading purposes. OptionType: minLength: 1 type: string description: 'Displays the type of options contract the symbol represents. Valid options include: Puts, Calls.' PointValue: type: number description: Symbol`s point value. Root: minLength: 1 type: string description: Displays the symbol of the stock on the stock exchange. # Pending to be documented. It's comment-out due to the information was not available when descriptions were added to fields. #SectionClassCode: # type: string # description: '(Japan Only)' # Pending to be documented. It's comment-out due to the information was not available when descriptions were added to fields. #SectionClassName: # type: string # description: '(Japan Only)' SectorName: type: string description: (Japan Only) Displays the assigned economic sector to which the equity symbol belongs. StrikePrice: type: number description: Displays strike price of an options contract; For Options symbols only. required: - Category - Country - Currency - Description - Exchange - ExchangeID - ExpirationDate - FutureType - LotSize - MinMove - Name - OptionType - PointValue - Root - StrikePrice type: object minItems: 0 type: array uniqueItems: true ############################################################################## SymbolSearchDefinition: description: '' items: properties: Category: minLength: 1 type: string description: 'The type of financial instrument that the symbol represents, such as a stock, index, or mutual fund.' Country: minLength: 1 type: string description: The country of the exchange where the symbol is listed. enum: - US - DE - CA Currency: minLength: 1 type: string description: Displays the type of base currency for the selected symbol. enum: - USD - AUD - CAD - CHF - DKK - EUR - DBP - HKD - JPY - NOK - NZD - SEK - SGD Description: minLength: 1 type: string description: Displays the full name of the symbol. DisplayType: type: number description: | Symbol's price display type based on the following list: * `0` "Automatic" Not used * `1` 0 Decimals => 1 * `2` 1 Decimals => .1 * `3` 2 Decimals => .01 * `4` 3 Decimals => .001 * `5` 4 Decimals => .0001 * `6` 5 Decimals => .00001 * `7` Simplest Fraction * `8` 1/2-Halves => .5 * `9` 1/4-Fourths => .25 * `10` 1/8-Eights => .125 * `11` 1/16-Sixteenths => .0625 * `12` 1/32-ThirtySeconds => .03125 * `13` 1/64-SixtyFourths => .015625 * `14` 1/128-OneTwentyEigths => .0078125 * `15` 1/256-TwoFiftySixths => .003906250 * `16` 10ths and Quarters => .025 * `17` 32nds and Halves => .015625 * `18` 32nds and Quarters => .0078125 * `19` 32nds and Eights => .00390625 * `20` 32nds and Tenths => .003125 * `21` 64ths and Halves => .0078125 * `22` 64ths and Tenths => .0015625 * `23` 6 Decimals => .000001 Error: type: string description: Element that references error. Exchange: minLength: 1 type: string description: Name of exchange where this symbol is traded in. ExchangeID: type: number description: A unique numerical identifier for the Exchange. ExpirationDate: minLength: 1 type: string description: Displays the expiration date for a futures or options contract in UTC formatted time. ExpirationType: type: string description: | For options only. It indicates whether the option is a monthly, weekly, quarterly or end of month expiration. * W - Weekly * M - Monthly * Q - Quartely * E - End of the month * "" - The term not be identified FutureType: minLength: 1 type: string description: Displays the type of future contract the symbol represents. IndustryCode: type: string description: (Japan Only) Displays a digit code that categorize companies by the type of business activities they engage in. IndustryName: type: string description: '(Japan Only) Displays the Reuters assigned industry name to which the equity symbol belongs.' # Pending to be documented. It's comment-out due to the information was not available when descriptions were added to fields. #IsPreferredExchange: # type: boolean # description: '(Japan Only)' LotSize: type: number description: (Japan Only) The currency amount associated with a lot (contract) in the specified account. MinMove: type: number description: 'Multiplying factor using the display type to determine the minimum price increment the asset trades in. For options the MinMove may vary. If the MinMove is negative, then the MinMove is dependent on the price. The whole number portion of the min move is the threshold. The leftmost two digits to the right of the decimal (X.XXXX) indicate the min move beneath the threshold, and the rightmost two digits (X.XXXX) indicate the min move above the threshold.' Name: minLength: 1 type: string description: A unique series of letters assigned to a security for trading purposes. OptionType: minLength: 1 type: string description: 'Displays the type of options contract the symbol represents. Valid options include: Puts, Calls.' PointValue: type: number description: Symbol`s point value. Root: minLength: 1 type: string description: 'Displays the symbol of the stock on the stock exchange.' # Pending to be documented. It's comment-out due to the information was not available when descriptions were added to fields. #SectionClassCode: # type: string # description: '(Japan Only)' # Pending to be documented. It's comment-out due to the information was not available when descriptions were added to fields. #SectionClassName: # type: string # description: '(Japan Only)' SectorName: type: string description: (Japan Only) Displays the assigned economic sector to which the equity symbol belongs. StrikePrice: type: number description: Displays strike price of an options contract; For Options symbols only. Underlying: type: string description: The financial instrument on which an option contract is based or derived. required: - Category - Country - Currency - Description - DisplayType - Exchange - ExchangeID - ExpirationDate - FutureType - LotSize - MinMove - Name - OptionType - PointValue - Root - StrikePrice - Underlying type: object minItems: 1 type: array uniqueItems: true ############################################################################## QuoteDefinition: description: Quote object used in data/quote items: properties: Ask: type: number description: 'The price at which a security, futures contract, or other financial instrument is offered for sale.' AskPriceDisplay: minLength: 1 type: string description: Ask price formatted for display. AskSize: type: number description: The number of trading units that prospective sellers are prepared to sell. AssetType: minLength: 1 type: string description: The name of asset type for a symbol enum: - INDEX - STOCK - STOCKOPTION - FUTURE - FOREX - UNKNOWN Bid: type: number description: The highest price a prospective buyer is prepared to pay at a particular time for a trading unit of a given symbol. BidPriceDisplay: minLength: 1 type: string description: Bid price formatted for display. BidSize: type: number description: The number of trading units that prospective buyers are prepared to purchase for a symbol. Close: type: number description: The net Realized Profit or Loss denominated in the symbol currency for the current trading session. This value includes any gain or loss as a result of closing a position during the current trading session ClosePriceDisplay: minLength: 1 type: string description: Daily running close price formatted for display. CountryCode: minLength: 1 type: string description: The country of the exchange where the symbol is listed. Currency: minLength: 1 type: string description: The base currency of the symbol. enum: - USD - AUD - CAD - CHF - DKK - EUR - DBP - HKD - JPY - NOK - NZD - SEK - SGD DailyOpenInterest: type: number description: 'The total number of open or outstanding (not closed or delivered) options and/or futures contracts that exist on a given day, delivered on a particular day.' DataFeed: minLength: 1 type: string description: The data quote feed provider. Description: minLength: 1 type: string description: Displays the full name of the symbol. DisplayType: type: number description: | Symbol's price display type based on the following list: * `0` "Automatic" Not used * `1` 0 Decimals => 1 * `2` 1 Decimals => .1 * `3` 2 Decimals => .01 * `4` 3 Decimals => .001 * `5` 4 Decimals => .0001 * `6` 5 Decimals => .00001 * `7` Simplest Fraction * `8` 1/2-Halves => .5 * `9` 1/4-Fourths => .25 * `10` 1/8-Eights => .125 * `11` 1/16-Sixteenths => .0625 * `12` 1/32-ThirtySeconds => .03125 * `13` 1/64-SixtyFourths => .015625 * `14` 1/128-OneTwentyEigths => .0078125 * `15` 1/256-TwoFiftySixths => .003906250 * `16` 10ths and Quarters => .025 * `17` 32nds and Halves => .015625 * `18` 32nds and Quarters => .0078125 * `19` 32nds and Eights => .00390625 * `20` 32nds and Tenths => .003125 * `21` 64ths and Halves => .0078125 * `22` 64ths and Tenths => .0015625 * `23` 6 Decimals => .000001 Error: type: string description: Error message received from exchange or Tradestation. Exchange: minLength: 1 type: string description: Name of exchange where this symbol is traded in. ExpirationDate: minLength: 1 type: string description: The UTC expiration date of a contract in ISO 8601 date format (yyyy-mm-dd). Valid only on options and futures symbols. For other categories this field is empty. FirstNoticeDate: type: string description: The day after which an investor who has purchased a futures contract may be required to take physical delivery of the contracts underlying commodity. FractionalDisplay: type: boolean description: Determine whether fractional price display is required. Halted: type: boolean description: A temporary suspension of trading for a particular security or securities at one exchange or across numerous exchanges. High: type: number description: Highest price of the day. High52Week: type: number description: The highest price of the past 52 weeks. This is a grid-based indicator. High52WeekPriceDisplay: minLength: 1 type: string description: High52Week price formatted for display. High52WeekTimeStamp: minLength: 1 type: string description: Date and time of the highest price in the past 52 week. HighPriceDisplay: minLength: 1 type: string description: High price formatted for display. IsDelayed: type: boolean description: True if the quote is a delayed quote and False if the quote is a real-time quote Last: type: number description: The last price at which the symbol traded. LastPriceDisplay: minLength: 1 type: string description: Last price formatted for display. LastSize: type: number description: Number of contracts/shares last traded. LastTradingDate: type: string description: The final day that a futures contract may trade or be closed out before the delivery of the underlying asset or cash settlement must occur. LastVenue: type: string description: Exchange name of last trade. Low: type: number description: Lowest price of stock. Low52Week: type: number description: The lowest price of the past 52 weeks. Low52WeekPriceDisplay: minLength: 1 type: string description: Low52Week price formatted for display. Low52WeekTimeStamp: minLength: 1 type: string description: Date and time of the lowest price of the past 52 weeks. LowPriceDisplay: minLength: 1 type: string description: Low price formatted for display. MaxPrice: type: number description: The maximum price a commodity futures contract may be traded for the current session. MaxPriceDisplay: type: string description: MaxPrice formatted for display. MinMove: type: number description: 'Multiplying factor using the display type to determine the minimum price increment the asset trades in. For options the MinMove may vary. If the MinMove is negative, then the MinMove is dependent on the price. The whole number portion of the min move is the threshold. The leftmost two digits to the right of the decimal (X.XXXX) indicate the min move beneath the threshold, and the rightmost two digits (X.XXXX) indicate the min move above the threshold.' MinPrice: type: number description: The minimum price a commodity futures contract may be traded for the current session. MinPriceDisplay: type: string description: MinPrice formatted for display. NameExt: type: string description: If the Quote is delayed this property will be set to `D` NetChange: type: number description: The difference between the last displayed price and the previous day`s close. NetChangePct: type: number description: 'The difference between the current price and the previous day`s close, expressed in a percentage.' Open: type: number description: 'The unrealized profit or loss denominated in the symbol currency on the position held, calculated based on the average price of the position.' OpenPriceDisplay: minLength: 1 type: string description: Open price formatted for display. PointValue: type: number description: 'The currency value represented by a full point of price movement. In the case of stocks, the Big Point Value is usually 1, in that 1 point of movement represents 1 dollar, however it may vary.' PreviousClose: type: number description: The closing price of the previous day. PreviousClosePriceDisplay: minLength: 1 type: string description: PreviousClose price formatted for display. PreviousVolume: type: number description: Daily volume of the previous day. Restrictions: items: type: string type: array description: A symbol specific restrictions for Japanese equities. StrikePrice: type: number description: The price at which the underlying contract will be delivered in the event an option is exercised. StrikePriceDisplay: minLength: 1 type: string description: StrikePrice formatted for display. Symbol: minLength: 1 type: string description: The name identifying the financial instrument for which the data is displayed. SymbolRoot: minLength: 1 type: string description: The symbol used to identify the option`s financial instrument for a specific underlying asset that is traded on the various trading exchanges. TickSizeTier: type: number description: Trading increment based on a level group. TradeTime: minLength: 1 type: string description: Trade execution time. Underlying: type: string description: The financial instrument on which an option contract is based or derived. Volume: type: number description: The number of shares or contracts traded in a security or an entire market during a given period of time. VWAP: type: number description: | VWAP (Volume Weighted Average Price) is a measure of the price at which the majority of a given day's trading in a given security took place. It is calculated by adding the dollars traded for the average price of the bar throughout the day ("avgprice" x "number of shares traded" per bar) and dividing by the total shares traded for the day. The VWAP is calculated throughout the day by the TradeStation data-network. VWAPDisplay: type: string description: VWAP formatted for display. required: - Symbol - SymbolRoot - Underlying - Description - AssetType - Exchange - FractionalDisplay - DisplayType - Open - OpenPriceDisplay - High - HighPriceDisplay - Low - LowPriceDisplay - PreviousClose - PreviousClosePriceDisplay - Last - LastPriceDisplay - LastSize - LastVenue - Ask - AskPriceDisplay - AskSize - Bid - BidPriceDisplay - BidSize - NetChange - NetChangePct - High52Week - High52WeekTimeStamp - High52WeekPriceDisplay - Low52Week - Low52WeekTimeStamp - Low52WeekPriceDisplay - Volume - PreviousVolume - Currency - CountryCode - StrikePrice - StrikePriceDisplay - NameExt - MinMove - TickSizeTier - PointValue - Close - ClosePriceDisplay - DailyOpenInterest - IsDelayed - DataFeed - Restrictions - TradeTime - VWAP - VWAPDisplay type: object minItems: 1 type: array uniqueItems: true ############################################################################## SymbolListsDefinition: description: '' items: $ref: '#/definitions/SymbolListDefinition' minItems: 1 type: array uniqueItems: true ############################################################################## SymbolListDefinition: description: '' properties: Category: minLength: 1 type: string description: Second Level of Symbol List Hierarchy. ID: minLength: 1 type: string description: Unique symbol list identifier. Name: minLength: 1 type: string description: Symbol List Name. Path: minLength: 1 type: string description: Full hierarchy path including name. RootCategory: minLength: 1 type: string description: First Level of Symbol List Hierarchy. Subcategory: minLength: 1 type: string description: Thrid Level of Symbol List Hierarchy. required: - Category - ID - Name - Path - RootCategory - Subcategory type: object SymbolListSymbolsDefinition: description: '' items: properties: Description: minLength: 1 type: string description: Displays the full name of the symbol. Exchange: minLength: 1 type: string description: Name of exchange where this symbol is traded in. Name: minLength: 1 type: string description: A unique series of letters assigned to a security for trading purposes. required: - Description - Exchange - Name type: object minItems: 1 type: array uniqueItems: true UserAccountsDefinition: description: '' items: properties: Alias: type: string description: A user specified name that identifies a TradeStation account. AltId: type: string description: TradeStation Alternate ID. DisplayName: minLength: 1 type: string description: Set to Alternate ID if it exists otherwise will be the TradeStation Account ID IsStockLocateEligible: type: boolean description: 'True if this account is stock locate eligible; otherwise, false.' Key: type: number description: Account Identifier. Name: minLength: 1 type: string description: Account Name. Type: minLength: 1 type: string description: | Type of the account: * `C` Cash * `M` Margin * `F` Futures * `D` DVP TypeDescription: minLength: 1 type: string description: Name of the type of the account. enum: - Cash - Margin - DVP - Futures Status: minLength: 1 type: string description: | Status of a specific account. * A - Active * X - Closed * C - Closing Transaction Only * F - Margin Call - Closing Transactions Only * I - Inactive * L - Liquidating Transactions Only * R - Restricted * D - 90 Day Restriction-Closing Transaction Only enum: - A - X - C - F - I - L - R - D StatusDescription: minLength: 1 type: string description: String value for Status attribute. required: - Alias - DisplayName - IsStockLocateEligible - Key - Name - Type - TypeDescription type: object minItems: 1 type: array uniqueItems: true ############################################################################## AccountBalancesDefinition: description: '' items: properties: Alias: type: string description: A user specified name that identifies a TradeStation account. BODAccountBalance: description: (Equities) Deprecated. The amount of cash in the account at the beginning of the day. Redundant with BODNetCash. type: number BODDayTradingMarginableEquitiesBuyingPower: description: (Equities) The Intraday Buying Power (Day Trading Rule 431) with which the account started the trading day. type: number BODEquity: type: number description: 'The total amount of equity with which you started the current trading day. Sum of the beginning day cash balance for your account and the market value of all positions brought into the current trading day (those that were held overnight) minus the outstanding margin debit balance for the account at the start of the current trading day. (Cash balance) + (Long market value) + (Short Credit) - (Margin Debit) + (Short Market Value). For cash accounts, also includes UnsettledFunds. For futures accounts, also includes securities on deposit.' BODNetCash: type: number description: The amount of cash in the account at the beginning of the day. BODOpenTradeEquity: description: (Futures) Unrealized profit and loss at the beginning of the day. type: number BODOptionBuyingPower: description: (Equities) Option buying power at the start of the trading day. type: number BODOptionValue: description: (Equities) Liquidation value of options at the start of the trading day. type: number BODOvernightBuyingPower: description: (Equities) Overnight Buying Power (Regulation T) at the start of the trading day. type: number CanDayTrade: description: (Equities) Indicates whether day trading is allowed in the account. type: boolean ClosedPositions: items: type: object properties: Currency: type: string description: The base currency of the symbol. Profit: type: number description: This value includes any gain or loss as a result of closing a position. Symbol: type: string description: The name identifying the financial instrument for which the data is displayed. required: - Currency - Profit - Symbol type: array Commission: description: (Futures) The brokerage commission cost and routing fees (if applicable) for a trade based on the number of shares or contracts. type: number DayTradeExcess: description: '(Equities) (Buying Power Available - Buying Power Used) / Buying Power Multiplier, (Futures) (Cash + UnrealizedGains) - Buying Power Used' type: number DayTradeOpenOrderMargin: description: (Futures) Money field representing the current amount of money reserved for open orders. type: number DayTrades: description: (Equities) The number of day trades placed in the account within the previous 4 trading days. A day trade refers to buying then selling or selling short then buying to cover the same security on the same trading day. type: number DayTradingQualified: description: (Equities) Indicates if the account is qualified to day trade as per compliance suitability in TradeStation. type: boolean Currency: description: (Futures) The base currency of the symbol. minLength: 1 type: string CurrencyDetails: description: (Futures) Currency details of the symbol. items: properties: AccountOpenOrderInitMargin: type: number description: The margin account balance denominated in the account currency required for entering a position on margin. BODAccountCashBalance: type: number description: Indicates the dollar amount of Beginning Day Account Cash Balance. BODAccountOpenTradeEquity: type: number description: Indicates the dollar amount of Beginning Day Trade Equity for the given futures account. BODAccountSecurities: type: number description: Indicates the dollar amount of Beginning Day Account Securities. BODCashBalance: type: number description: Indicates the dollar amount of Beginning Day Cash Balance for the given futures account. BODOpenTradeEquity: type: number description: Indicates the dollar amount of Beginning Day Open Trade Equity. BODSecurities: type: number description: Indicates the dollar amount of Beginning Day Securities. Commission: type: number description: The actual brokerage commission cost and routing fees (if applicable) for a trade based on the number of shares or contracts. Currency: minLength: 1 type: string description: The base currency of the symbol. OpenOrderInitMargin: type: number description: The dollar amount of Open Order Initial Margin for the given futures account. RealTimeAccountCashBalance: type: number description: Indicates the value of real-time account cash balance. RealTimeAccountInitMargin: type: number description: Indicates the value of real-time account initial margin. RealTimeAccountMaintenanceMargin: type: number description: Indicates the value of real-time account maintance margin. RealTimeAccountMarginRequirement: type: number description: Indicates the value of real-time account margin requirement. RealTimeAccountRealizedProfitLoss: type: number description: Indicates the value of real-time account realized profit or loss. RealTimeAccountUnrealizedProfitLoss: type: number description: Indicates the value of real-time account unrealized profit or loss. RealTimeCashBalance: type: number description: Indicates the value of real-time cash balance. RealTimeInitMargin: type: number description: Indicates the value of real-time initial margin. RealTimeMaintenanceMargin: type: number description: Indicates the value of real-time maintance margin. RealTimeRealizedProfitLoss: type: number description: Indicates the value of real-time realized profit or loss. RealTimeUnrealizedProfitLoss: type: number description: Indicates the value of real-time unrealized profit or loss. ToAccountConversionRate: type: number description: Indicates the rate used to convert from the currency of the symbol to the currency of the account. TodayRealTimeUnrealizedProfitLoss: type: number description: Indicates the value of today's real-time unrealized profit or loss. required: - BODAccountCashBalance - BODCashBalance - Commission - Currency - RealTimeAccountCashBalance - RealTimeAccountMarginRequirement - RealTimeAccountRealizedProfitLoss - RealTimeAccountUnrealizedProfitLoss - RealTimeCashBalance - RealTimeRealizedProfitLoss - RealTimeUnrealizedProfitLoss - ToAccountConversionRate - AccountOpenOrderInitMargin - BODAccountOpenTradeEquity - BODAccountSecurities - BODOpenTradeEquity - BODSecurities - OpenOrderInitMargin - RealTimeAccountInitMargin - RealTimeAccountMaintenanceMargin - RealTimeInitMargin - RealTimeMaintenanceMargin - TodayRealTimeUnrealizedProfitLoss minItems: 1 type: array uniqueItems: true DisplayName: minLength: 1 type: string description: The friendly name of the specific TradeStation account. Key: type: number description: Key is the unique identifier for the requested account. MarketValue: type: number description: Market value of open positions. Name: minLength: 1 type: string description: name of the account. OptionApprovalLevel: description: | (Equities) The option approval level will determine what options strategies you will be able to employ in the account. In general terms, the levels are defined as follows * Level 0 - No options trading allowed. * Level 1 - Writing of Covered Calls, Buying Protective Puts. * Level 2 - Level 1 + Buying Calls, Buying Puts, Writing Covered Puts. * Level 3 - level 2+ Stock Option Spreads, Index Option Spreads, Butterfly Spreads, Condor Spreads, Iron Butterfly Spreads, Iron Condor Spreads. * Level 4 - Level 3 + Writing of Naked Puts (Stock Options). * Level 5 - Level 4 + Writing of Naked Puts (Index Options), Writing of Naked Calls (Stock Options), Writing of Naked Calls (Index Options). enum: - 0 - 1 - 2 - 3 - 4 - 5 type: number OpenOrderMargin: description: (Futures) The dollar amount of Open Order Margin for the given futures account. type: number PatternDayTrader: description: > (Equities) Indicates whether you are considered a pattern day trader. As per FINRA rules, you will be considered a pattern day trader if you trade 4 or more times in 5 business days and your day-trading activities are greater than 6 percent of your total trading activity for that same five-day period. A pattern day trader must maintain a minimum equity of $25,000 on any day that the customer day trades. If the account falls below the $25,000 requirement, the pattern day trader will not be permitted to day trade until the account is restored to the $25,000 minimum equity level. type: boolean RealTimeAccountBalance: type: number description: Current cash balance of the account. RealTimeBuyingPower: type: number description: Indicates the value of real-time buying power. RealTimeCostOfPositions: description: (Equities) Total real-time cost of all open positions. Positions are based on the actual entry price. type: number RealTimeDayTradeMargin: description: (Futures) Money field representing the current total amount of futures day trade margin. type: number RealTimeDayTradingMarginableEquitiesBuyingPower: description: (Equities) The intraday buying power for trading marginable equities. type: number RealTimeEquity: description: 'The real-time cash reserves for your account. At the beginning of the trading day, this value will equal the beginning day cash balance. This figure is calculated by taking the real-time cash balance plus the market value of any long positions minus the market value of any short position. (Real-time cash balance) + (Market value of long positions) – (Market value of short positions) + (Liquidation value of options)' type: number RealTimeInitialMargin: description: (Futures) Sum (Initial Margins of all positions in the given account) type: number RealTimeOptionBuyingPower: description: (Equities) The intraday buying power for options. type: number RealTimeOptionValue: description: (Equities) Intraday liquidation value of option positions. type: number RealTimeOvernightBuyingPower: description: (Equities) Real-time Overnight Marginable Equities Buying Power. type: number RealTimeMaintenanceMargin: description: (Futures) The dollar amount of Real-time Maintenance Margin for the given futures account. type: number RealTimeRealizedProfitLoss: type: number description: Indicates any gain or loss as a result of closing a position during the current trading day. This value also includes all commissions and routing fees incurred during the current trading day. RealTimeTradeEquity: type: number description: (Futures) The dollar amount of unrealized profit and loss for the given futures account. Same value as RealTimeUnrealizedGains. RealTimeUnrealizedGains: type: number description: 'Unrealized profit and loss, for the current trading day, of all open positions.' RealTimeUnrealizedProfitLoss: type: number description: Unrealized profit or loss of all open positions using current market prices. SecurityOnDeposit: description: (Futures) The value of special securities that are deposited by the customer with the clearing firm for the sole purpose of increasing purchasing power in their trading account. This number will be reset daily by the account balances clearing file. The entire value of this field will increase purchasing power. type: number Status: minLength: 1 type: string description: | Status of a specific account. * A - Active * X - Closed * C - Closing Transaction Only * F - Margin Call - Closing Transactions Only * I - Inactive * L - Liquidating Transactions Only * R - Restricted * D - 90 Day Restriction-Closing Transaction Only enum: - A - X - C - F - I - L - R - D StatusDescription: minLength: 1 type: string description: String value for Status attribute. TodayRealTimeTradeEquity: description: (Futures) The unrealized P/L for today. Unrealized P/L - BODOpenTradeEquity type: number Type: minLength: 1 type: string description: | The type of the account. * C - Cash * M - Margin * D - DVP * F - Futures enum: - C - M - D - F TypeDescription: minLength: 1 type: string description: String value for Type Attribute. UnclearedDeposit: type: number description: The total of uncleared checks received by TradeStation for deposit. UnsettledFund: description: (Equities) Funds received by TradeStation that are not settled from a transaction in the account. type: number required: - Alias - BODEquity - BODNetCash - ClosedPositions - DisplayName - Key - MarketValue - Name - RealTimeAccountBalance - RealTimeBuyingPower - RealTimeEquity - RealTimeRealizedProfitLoss - RealTimeUnrealizedGains - RealTimeUnrealizedProfitLoss - Status - StatusDescription - Type - TypeDescription - UnclearedDeposit - BODOpenTradeEquity - Commission - Currency - CurrencyDetails - OpenOrderMargin - RealTimeInitialMargin - RealTimeMaintenanceMargin - RealTimeTradeEquity - SecurityOnDeposit - TodayRealTimeTradeEquity type: object minItems: 1 type: array uniqueItems: true ############################################################################## AccountPositionsDefinition: description: '' items: properties: AccountID: minLength: 1 type: string description: TradeStation account that holds the position. AccountMarketValue: type: number description: The actual market value denominated in the account currency of the open position. AccountOpenProfitLoss: type: number description: 'The unrealized profit or loss denominated in the account currency on the position held, calculated based on the average price of the position.' AccountTotalCost: type: number description: The total cost denominated in the account currency of the open position. Alias: type: string description: A user specified name that identifies a TradeStation account. AskPrice: type: number description: 'The price at which a security, futures contract, or other financial instrument is offered for sale.' AskPriceDisplay: minLength: 1 type: string description: Formatted text representation of the AskPrice for easy display AssetType: minLength: 1 type: string description: | Indicates the asset type of the position * EQ - Equity * OP - Option * Fu - Future enum: - EQ - Op - Fu AveragePrice: type: number description: Average price of all positions for the current symbol. AveragePriceDisplay: minLength: 1 type: string description: String value for AveragePrice attribute. BidPrice: type: number description: The highest price a prospective buyer is prepared to pay at a particular time for a trading unit of a given symbol. BidPriceDisplay: minLength: 1 type: string description: Formatted text representation of the BidPrice for easy display BigPointValue: type: number description: Dollar value for a one point movement. ContractExpireDate: minLength: 1 type: string description: Contract expiration date for positions specified in contracts. ConversionRate: type: number description: The currency conversion rate that is used in order to convert from the currency of the symbol to the currency of the account. CostBasisCalculation: type: string description: 'Only applies to margin accounts based in Japan. When set to ''FSA'' an additional property, UnrealizedExpenses, will be included in the payload. For other account types, the value will always be ''None''' Country: minLength: 1 type: string description: The country of the exchange where the symbol is listed. Currency: minLength: 1 type: string description: The base currency of the symbol. DayTradeMargin: minLength: 1 type: string description: (Futures) DayTradeMargin used on open positions. Currently only calculated for futures positions. Other asset classes will have a 0 for this value. Description: minLength: 1 type: string description: Displays the full name of the symbol. DisplayName: minLength: 1 type: string description: DO NOT USE - Marked for deprecation. InitialMargin: type: number description: The margin account balance denominated in the account currency required for entering a position on margin. Key: type: number description: A unique identifier for the position. LastPrice: type: number description: The last price at which the symbol traded. LastPriceDisplay: minLength: 1 type: string description: Formatted text representation of the LastPrice for easy display LongShort: minLength: 1 type: string description: | Specifies if the position is Long or Short. * A Long position is when the holder buys an option to open a position, and where the number or price of options bought exceeds the number or price of options sold. * A Short position is when the writer sells an option to open a position, and where the number or price of options sold exceeds the number or price of options bought. enum: - Long - Short MaintenanceMargin: type: number description: The margin account balance denominated in the account currency required for maintaining a position on margin. MarketValue: type: number description: The actual market value denominated in the symbol currency of the open position. This value is updated in real-time. MarkToMarketPrice: type: number description: | The "MarkToMarket" price is a weighted average price. The "weight" given to each price in the calculation of the average is the number of shares. Sales or short positions have negative weights. Purchases or long positions have positive weights. All shares entered on prior days are valued at the preceding day's closing price. All shares bought or sold today are valued at the price at which the shares were bought or sold today. The value of "Today's Profit/Loss" (of the shares in an open position) is the difference between the current market price and the "MarkToMarket" price, multiplied by the number of shares currently held. OpenProfitLoss: type: number description: 'The unrealized profit or loss denominated in the symbol currency on the position held, calculated based on the average price of the position.' OpenProfitLossPercent: type: number description: The unrealized profit or loss on the position expressed as a percentage of the initial value of the position. OpenProfitLossQty: type: number description: 'The unrealized profit or loss denominated in the account currency divided by the number of shares, contracts or units held.' Quantity: type: number description: The requested number of shares or contracts for a particular order. RequiredMargin: type: number description: (Forex) The margin account balance denominated in the account currency required for entering and maintaining a position on margin. SettlePrice: type: number description: 'The average price at which a contract trades, calculated at both the open and close of each trading day, and it is important because it determines whether a trader is required to post additional margins.' StrikePrice: type: number description: 'The strike price is the stated price per share or per contract for which the underlying asset may be purchased, or sold, by the option holder upon exercise of the option contract.' StrikePriceDisplay: minLength: 1 type: string description: Formatted text representation of the StrikePrice for easy display Symbol: minLength: 1 type: string description: Symbol of the current position. TimeStamp: minLength: 1 type: string description: Time the position was placed. TodaysProfitLoss: type: number description: 'Only applies to equity and option positions. When AssetType is ''EQ'' or ''OP'', this value will be included in the payload to convey the unrealized profit or loss denominated in the account currency on the position held, calculated using the MarkToMarketPrice.' TotalCost: type: number description: The total cost denominated in the account currency of the open position. UnrealizedExpenses: type: number description: 'Only applies to margin accounts based in Japan. When CostBasisCalculation is to ''FSA'', UnrealizedExpenses, will be included in the payload, and will convey interest expenses and buy order commissions.' required: - AccountID - AccountMarketValue - AccountOpenProfitLoss - AccountTotalCost - Alias - AskPrice - AskPriceDisplay - AssetType - AveragePrice - AveragePriceDisplay - BidPrice - BidPriceDisplay - BigPointValue - ContractExpireDate - ConversionRate - CostBasisCalculation - Country - Currency - Description - DisplayName - InitialMargin - Key - LastPrice - LastPriceDisplay - LongShort - MaintenanceMargin - MarketValue - MarkToMarketPrice - OpenProfitLoss - OpenProfitLossPercent - OpenProfitLossQty - Quantity - RequiredMargin - SettlePrice - StrikePrice - StrikePriceDisplay - Symbol - TimeStamp - TodaysProfitLoss - TotalCost type: object minItems: 1 type: array uniqueItems: true ############################################################################## AccountOrdersDefinition: description: '' items: properties: AccountID: minLength: 1 type: string description: ID that identifies a specific TradeStation account that is being used for a particular order. AdvancedOptions: type: string description: Will display a value when the order has advanced order rules associated with it or is part of a bracket order. enum: - Activation Rule - All or None - Trailing Stop - If Touched - Show Only - Discretionary - Non-Display - Peg - Book Only - Add Liquidity Alias: type: string description: A user specified name that identifies a TradeStation account. AssetType: minLength: 1 type: string description: | * FU = Future * EQ = Equity * OP = Stock Option * FX = Forex enum: - FU - EQ - OP - FX CommissionFee: type: number description: Commission paid in an order. ContractExpireDate: minLength: 1 type: string description: Displays the contract expiration date for orders specified in contracts. ConversionRate: type: number description: Conversion rate used to translate the position’s market value and PNL from symbol currency to account currency. CostBasisCalculation: type: string description: 'Only applies to margin accounts based in Japan. When set to ''FSA'' an additional property, RealizedExpenses, will be included in the payload. For other account types, the value will always be ''None''' Country: type: string description: The country of origin for the symbol. Denomination: minLength: 1 type: string description: Currency used to complete the order. DisplayName: type: string description: Displays the Monex user ID. Used only by Monex. DisplayType: type: number description: Number of decimal points to display for the price. Duration: minLength: 1 type: string description: The amount of time for which an order is valid. ExecuteQuantity: type: number description: Number of shares that have been executed. FilledCanceled: minLength: 1 type: string description: The time the order was filled or canceled. FilledPrice: type: number description: 'At the top level, this is the average fill price. For expanded levels, this is the actual execution price.' FilledPriceText: minLength: 1 type: string description: String value for FilledPrice attribute. GroupName: type: string description: It can be used to identify orders that are part of the same bracket. Legs: items: properties: Ask: type: number description: 'The price at which a security, futures, or other financial instrument is offered for sale.' BaseSymbol: type: string description: Symbol of the underlying stock for an option trade. Bid: type: number description: The highest price a prospective buyer is prepared to pay at a particular time for a trading unit of a given symbol. ExecPrice: type: number description: The execution price for the order. ExecQuantity: type: number description: Number of shares executed. ExpireDate: type: string description: The expiration date of the future or option symbol. Leaves: type: number description: It will display the number of shares that have not yet filled if the entire quantity has not been filled. LegNumber: type: number description: 'For an equity purchase, the value will be 1. For option spreads, there will be a leg for each option.' LimitPrice: type: number description: The limit price for Limit orders LimitPriceDisplay: minLength: 1 type: string description: String value for LimitPrice attribute. Month: type: number description: Expiration month for options or futures. OpenOrClose: minLength: 1 type: string description: Identifies whether the order is an Opening or Closing trade. OrderID: type: number description: ID of the current order. OrderType: minLength: 1 type: string description: | Identifies the order type of the order. enum: - Market - Limit - Stop Limit - Stop Market PointValue: type: number description: Number of shares the order represents. Equities will normally display 1. Options will display 100. PriceUsedForBuyingPower: type: number description: Price used for the buying power calculation of the order. PutOrCall: type: string description: 'For an option order, identifies whether the order is for a Put or Call.' Quantity: type: number description: Number of shares or contracts being purchased. Side: minLength: 1 type: string description: | Identifies whether the order is a buy or sell. * `T` Sell Short * `C` Buy to Cover * `B` Buy * `S` Sell enum: - T - C - B - S StopPrice: type: number description: The stop price for stop orders. StopPriceDisplay: type: string description: String value for StopPrice attribute. StrikePrice: type: number description: 'For an option order, the strike price for the Put or Call.' Symbol: minLength: 1 type: string description: Symbol to trade. TimeExecuted: minLength: 1 type: string description: The time the order was filled or canceled. Type: minLength: 1 type: string description: Type of order enum: - Sell - Buy - Buy to Cover - Sell Short Year: type: number description: Represents the expiration year if the order is an option. required: - Ask - BaseSymbol - Bid - ExecPrice - ExecQuantity - ExpireDate - Leaves - LegNumber - LimitPrice - LimitPriceDisplay - Month - OpenOrClose - OrderID - OrderType - PointValue - PriceUsedForBuyingPower - PutOrCall - Quantity - Side - StopPrice - StopPriceDisplay - StrikePrice - Symbol - TimeExecuted - Type - Year minItems: 1 type: array uniqueItems: true LimitPrice: type: number description: The limit price for Limit and Stop Limit orders. LimitPriceText: minLength: 1 type: string description: String value of LimitPrice attribute. MarketActivationRules: type: array items: $ref: '#/definitions/MarketActivationRuleDefinition' description: | Set of market-based activation rules that must be met before order is sent to the exchange. MinMove: type: number description: 'Multiplying factor using the display type to determine the minimum price increment the asset trades in. For options the MinMove may vary. If the MinMove is negative, then the MinMove is dependent on the price. The whole number portion of the min move is the threshold. The leftmost two digits to the right of the decimal (X.XXXX) indicate the min move beneath the threshold, and the rightmost two digits (X.XXXX) indicate the min move above the threshold..' OrderID: type: number description: ID of the current order. Originator: type: number description: Identifies the TradeStation account that originated a particular order. Quantity: type: number description: The requested number of shares or contracts for a particular order. QuantityLeft: type: number description: 'In a partially filled order, this is the number of shares or contracts that were unfilled.' RealizedExpenses: type: number description: 'Only applies to margin accounts based in Japan. When CostBasisCalculation is to ''FSA'', RealizedExpenses, will be included in the payload, and will convey realized interest expenses and commissions for closing orders.' RejectReason: type: string description: 'If an order has been rejected, this will display the rejection reason.' Routing: minLength: 1 type: string description: Identifies the routing selection made by the customer when placing the order. ShowOnlyQuantity: type: integer description: This option allows you to hide the true number of shares that you wish to buy or sell. Spread: type: string description: The spread type for an option order. Status: minLength: 1 type: string description: | * OPN, ACK, UCN = Open Orders -- New order request pending, cancel request pending. * FLL, FLP = Filled Orders -- Partially-Filled and remaining canceled. * FPR = Partially Filled Orders. * OUT = Canceled Orders. * REJ, TSC = Rejected Orders -- It is an internal server(s) unsolicited cancel, not final status. * EXP = Expired Orders. * BRO = Broken Orders -- Not necessarily the order’s final status since later it may be reinstated to open. * CAN = Exch. Canceled Orders. * LAT = Too Late Orders -- Not the order’s final status. * DON = Queued Orders. enum: - OPN - ACK - UCN - FLL - FLP - FPR - OUT - REJ - TSC - Exp - BRO - CAN - LAT - DON StatusDescription: minLength: 1 description: Description for Status attribute. type: string StopPrice: type: number description: The stop price for stop orders. StopPriceText: minLength: 1 type: string description: String value for StopPrice attribute. Symbol: minLength: 1 type: string description: Symbol to trade. TimeActivationRules: type: array items: $ref: '#/definitions/TimeActivationRuleDefinition' description: | Set of time-based activation rules that must be met before order is sent to the exchange. TimeStamp: minLength: 1 type: string description: Time the order was placed. TrailingStop: $ref: '#/definitions/TrailingStopDefinition' TriggeredBy: type: string description: Will display a value if a stop limit or stop market order has been triggered. Type: minLength: 1 type: string description: Type of order. enum: - Sell - Buy - Buy to Cover - Sell Short UnbundledRouteFee: type: number description: Will contain a value if the order has received a routing fee. required: - AccountID - AdvancedOptions - Alias - AssetType - CommissionFee - ContractExpireDate - ConversionRate - CostBasisCalculation - Denomination - DisplayType - Duration - ExecuteQuantity - FilledCanceled - FilledPrice - FilledPriceText - GroupName - Legs - LimitPrice - LimitPriceText - MinMove - OrderID - Originator - Quantity - QuantityLeft - RejectReason - Routing - Spread - Status - StatusDescription - StopPrice - StopPriceText - Symbol - TimeStamp - TriggeredBy - Type - UnbundledRouteFee type: object minItems: 1 type: array uniqueItems: true ############################################################################## OrderConfirmRequestDefinition: properties: AccountKey: description: | Must be a valid Account Key for that user and Asset Type minLength: 1 type: string AdvancedOptions: $ref: '#/definitions/AdvancedOptionsDefinition' AssetType: minLength: 1 type: string enum: - EQ - FU - OP Duration: type: string enum: - DAY - DYP - GTC - GCP - GTD - GDP - OPG - CLO - IOC - FOK - 1 - 1 MIN - 3 - 3 MIN - 5 - 5 MIN description: | Allowed durations vary by Asset Type * DAY - Day, valid until the end of the regular trading session. * DYP - Day Plus; valid until the end of the extended trading session * GTC - Good till canceled * GCP - Good till canceled plus * GTD - Good through date * GDP - Good through date plus * OPG - At the opening; only valid for listed stocks at the opening session Price * CLO - On Close; orders that target the closing session of an exchange. * IOC - Immediate or Cancel; filled immediately or canceled, partial fills are accepted * FOK - Fill or Kill; orders are filled entirely or canceled, partial fills are not accepted * 1 or 1 MIN - 1 minute; expires after the 1 minute * 3 or 3 MIN - 3 minutes; expires after the 3 minutes * 5 or 5 MIN - 5 minutes; expires after the 5 minutes minLength: 1 GTDDate: description: | Date that Order is valid through. Input Format: MM/DD/YYYY Required for orders with Duration = GTD. minLength: 1 maxLength: 10 type: string format: mmddyyyy LimitPrice: minLength: 1 type: string StopPrice: minLength: 1 type: string OrderType: minLength: 1 type: string enum: - Limit - Market - StopLimit - StopMarket Quantity: minLength: 1 type: string Route: minLength: 1 type: string description: | Must be UPPERCASE. Valid values can be obtained from [Retrieve Available Exchanges](#operation/getExchanges) Symbol: description: Must be UPPERCASE minLength: 1 type: string TradeAction: type: string description: | Conveys the intent of the trade * BUY - `equities` and `futures` * SELL - `equities` and `futures` * BUYTOCOVER - `equities` * SELLSHORT - `equities` * BUYTOOPEN - `options` * BUYTOCLOSE - `options` * SELLTOOPEN - `options` * SELLTOCLOSE - `options` minLength: 1 enum: - BUY - SELL - BUYTOCOVER - SELLSHORT - BUYTOOPEN - BUYTOCLOSE - SELLTOOPEN - SELLTOCLOSE OSOs: items: type: object properties: Type: minLength: 1 type: string enum: - NORMAL - BRK - OCO Orders: items: $ref: '#/definitions/OrderConfirmRequestDefinition' minItems: 1 type: array uniqueItems: true required: - Type minItems: 1 type: array uniqueItems: true Legs: items: type: object properties: Symbol: description: Must be UPPERCASE minLength: 1 type: string Quantity: minLength: 1 type: string TradeAction: minLength: 1 type: string enum: - BUY - SELL - BUYTOCOVER - SELLSHORT - BUYTOOPEN - BUYTOCLOSE - SELLTOOPEN - SELLTOCLOSE description: | Conveys the intent of the trade * BUY - equity and futures trades * SELL - equity and futures trades * BUYTOCOVER - equity trade to close a short position * SELLSHORT - equity trade to open a short position * BUYTOOPEN - option trades * BUYTOCLOSE - option trades * SELLTOOPEN - option trades * SELLTOCLOSE - option trades minItems: 1 type: array uniqueItems: true required: - AssetType - Symbol - Quantity - OrderType - Duration - AccountKey - TradeAction type: object ############################################################################## OrderRequestDefinition: properties: AccountKey: description: | Must be a valid Account Key for that user and Asset Type minLength: 1 type: string AdvancedOptions: $ref: '#/definitions/AdvancedOptionsDefinition' AssetType: minLength: 1 type: string enum: - EQ - FU - OP Duration: type: string enum: - DAY - DYP - GTC - GCP - GTD - GDP - OPG - CLO - IOC - FOK - 1 - 1 MIN - 3 - 3 MIN - 5 - 5 MIN description: | Allowed durations vary by Asset Type * DAY - Day, valid until the end of the regular trading session. * DYP - Day Plus; valid until the end of the extended trading session * GTC - Good till canceled * GCP - Good till canceled plus * GTD - Good through date * GDP - Good through date plus * OPG - At the opening; only valid for listed stocks at the opening session Price * CLO - On Close; orders that target the closing session of an exchange. * IOC - Immediate or Cancel; filled immediately or canceled, partial fills are accepted * FOK - Fill or Kill; orders are filled entirely or canceled, partial fills are not accepted * 1 or 1 MIN - 1 minute; expires after the 1 minute * 3 or 3 MIN - 3 minutes; expires after the 3 minutes * 5 or 5 MIN - 5 minutes; expires after the 5 minutes minLength: 1 GTDDate: description: | Date that Order is valid through. Input Format: MM/DD/YYYY Required for orders with Duration = GTD. minLength: 1 maxLength: 10 type: string format: mmddyyyy LimitPrice: minLength: 1 type: string StopPrice: minLength: 1 type: string OrderConfirmId: description: | A unique identifier regarding an order used to prevent duplicates. Must be unique per API key, per order, per user. minLength: 1 maxLength: 25 type: string OrderType: minLength: 1 type: string enum: - Limit - Market - StopLimit - StopMarket Quantity: minLength: 1 type: string Route: minLength: 1 type: string description: | Must be UPPERCASE. Valid values can be obtained from [Retrieve Available Exchanges](#operation/getExchanges) Symbol: description: Must be UPPERCASE minLength: 1 type: string TradeAction: type: string description: | Conveys the intent of the trade * BUY - `equities` and `futures` * SELL - `equities` and `futures` * BUYTOCOVER - `equities` * SELLSHORT - `equities` * BUYTOOPEN - `options` * BUYTOCLOSE - `options` * SELLTOOPEN - `options` * SELLTOCLOSE - `options` minLength: 1 enum: - BUY - SELL - BUYTOCOVER - SELLSHORT - BUYTOOPEN - BUYTOCLOSE - SELLTOOPEN - SELLTOCLOSE OSOs: items: type: object properties: Type: minLength: 1 type: string enum: - NORMAL - BRK - OCO Orders: items: $ref: '#/definitions/OrderRequestDefinition' minItems: 1 type: array uniqueItems: true required: - Type minItems: 1 type: array uniqueItems: true Legs: items: type: object properties: Symbol: description: Must be UPPERCASE minLength: 1 type: string Quantity: minLength: 1 type: string TradeAction: minLength: 1 type: string enum: - BUY - SELL - BUYTOCOVER - SELLSHORT - BUYTOOPEN - BUYTOCLOSE - SELLTOOPEN - SELLTOCLOSE description: | Conveys the intent of the trade * BUY - equity and futures trades * SELL - equity and futures trades * BUYTOCOVER - equity trade to close a short position * SELLSHORT - equity trade to open a short position * BUYTOOPEN - option trades * BUYTOCLOSE - option trades * SELLTOOPEN - option trades * SELLTOCLOSE - option trades minItems: 1 type: array uniqueItems: true required: - AssetType - Symbol - Quantity - OrderType - Duration - AccountKey - TradeAction type: object ############################################################################## CancelReplaceDefinition: description: '' properties: LimitPrice: minLength: 1 type: string StopPrice: minLength: 1 type: string OrderType: minLength: 1 type: string Quantity: minLength: 1 type: string Symbol: minLength: 1 type: string AdvancedOptions: $ref: '#/definitions/CancelReplaceAdvancedOptionsDefinition' required: - OrderType - Quantity - Symbol type: object ############################################################################## CancelReplaceAdvancedOptionsDefinition: description: Advanced Options for an order properties: TrailingStop: $ref: '#/definitions/TrailingStopDefinition' MarketActivationRules: $ref: '#/definitions/CancelReplaceMarketActivationRuleDefinition' TimeActivationRules: $ref: '#/definitions/CancelReplaceTimeActivationRuleDefinition' ShowOnlyQuantity: type: integer description: | Number of shares to submit to market at a time for this order. Valid for futures and equities orders. For equities, must be multiple of 100. Cannot be added if original order did not have ShowOnlyQuantity. minimum: 0 exclusiveMinimum: true type: object ############################################################################## CancelReplaceMarketActivationRuleDefinition: description: Advanced Options for an order properties: ClearAll: type: boolean description: | If 'True', removes all activation rules when replacing the order and ignores any rules sent in `Rules`. Rules: type: array items: $ref: '#/definitions/MarketActivationRuleDefinition' description: | Set of market-based activation rules that must be met before order is sent to the exchange. Max 4 rules. maxItems: 4 type: object ############################################################################## CancelReplaceTimeActivationRuleDefinition: description: Advanced Options for an order properties: ClearAll: type: boolean description: | If 'True', removes all activation rules when replacing the order and ignores any rules sent in `Rules`. Rules: type: array items: $ref: '#/definitions/TimeActivationRuleDefinition' description: | Set of time-based activation rules that must be met before order is sent to the exchange. Max 1 rule. maxItems: 1 type: object ############################################################################## AdvancedOptionsDefinition: description: Advanced Options for an order properties: TrailingStop: $ref: '#/definitions/TrailingStopDefinition' MarketActivationRules: type: array items: $ref: '#/definitions/MarketActivationRuleDefinition' description: | Set of market-based activation rules that must be met before order is sent to the exchange. Max 4 rules. maxItems: 4 TimeActivationRules: type: array items: $ref: '#/definitions/TimeActivationRuleDefinition' description: | Set of time-based activation rules that must be met before order is sent to the exchange. Max 1 rule. maxItems: 1 ShowOnlyQuantity: type: integer description: | Number of shares to submit to market at a time for this order. Valid for futures and equities orders. For equities, must be multiple of 100. minimum: 0 exclusiveMinimum: true type: object ############################################################################## MarketActivationRuleDefinition: description: Market Activation Rules that must be met before the order is sent to the exchange. type: object properties: RuleType: description: | Type of the activation rule. Currently only support "Price" type: string enum: - Price Symbol: description: | Symbol that the rule is based on type: string Predicate: description: | The predicate comparison for the market rule type. E.g. Lt (less than). type: string enum: - Lt - Lte - Gt - Gte TriggerKey: description: | The ticks behavior for the activation rule. type: string enum: - STT - STTN - SBA - SAB - DTT - DTTN - DBA - DAB - TTT - TTTN - TBA - TAB Price: description: | Valid only for Type="Price", the price at which the rule will trigger when the price hits ticks as specified by TriggerType type: string LogicOperator: description: | Relation with the previous activation rule when given a list of MarketActivationRules. Ignored for the first MarketActivationRule. type: string enum: - And - Or ############################################################################## TimeActivationRuleDefinition: description: Time Activation Rules that must be met before the order is sent to the exchange. type: object properties: TimeUtc: description: | Order is activated once current UTC time is greater thans or equal to TimeUtc. hh:mm:ss type: string ############################################################################## TrailingStopDefinition: description: Trailing Stop offset; amount or percent type: object properties: Amount: description: | Currency Offset from current price. Note: Mutually exclusive with Percent. type: number Percent: description: | Percentage offset from current price. Note: Mutually exclusive with Amount. type: number ############################################################################## OrderConfirmResponseDefinition: description: Order Confirm definition. The response will also contain asset-specific fields type: object properties: Route: type: string description: 'The path chosen for directing a trade to a certain destination, such as an ECN, MM, Exchange, or Intelligent.' Duration: type: string description: The amount of time for which an order is valid. Duration is the same as TIF (Time in Force). Account: type: string description: The number that identifies a specific TradeStation account that is being used for a particular order. OrderConfirmId: type: string description: Unique id generated per order per API Key and User EstimatedPrice: type: number description: 'An estimated value that is calculated using current market information. The actual cost for Market orders and orders with conditions, such as Trailing Stop or Activation Rule orders, may differ significantly from this estimate.' EstimatedPriceDisplay: type: string description: Equity and Futures Orders; Estimated price formatted for display EstimatedCost: type: number description: 'The actual cost for Market orders and orders with conditions, such as Trailing Stop or Activation Rule orders.' EstimatedCostDisplay: type: string description: Equity Orders; Estimated cost formatted for display DebitCreditEstimatedCost: type: number description: 'The actual cost for Market orders and orders with conditions, such as Trailing Stop or Activation Rule orders. Takes into account wheather or not the transaction will result in a debit or credit to the user.' DebitCreditEstimatedCostDisplay: type: string description: Equity Orders; Debit credit estimated cost formatted for display EstimatedCommission: type: number description: An estimated value that is calculated using the published TradeStation commission schedule. Equity and Futures Orders EstimatedCommissionDisplay: type: string description: Equity and Futures Orders; Estimated commission formatted for display BaseCurrency: type: string description: 'Forex Orders; ' CounterCurrency: type: string description: Forex Orders; Estimated cost formatted for display InitialMarginDisplay: type: string description: Forex and Futures Orders; Initial margin cost formatted for display in currency of asset ProductCurrency: type: string description: 'Futures Orders; ' AccountCurrency: type: string description: 'Futures Orders; ' TrailingStop: $ref: '#/definitions/TrailingStopDefinition' MarketActivationRules: type: array items: $ref: '#/definitions/MarketActivationRuleDefinition' TimeActivationRules: type: array items: $ref: '#/definitions/TimeActivationRuleDefinition' ShowOnlyQuantity: type: integer description: Equity and Futures Orders; Number of shares to submit to market at a time for this order required: - Route - Duration - Account - OrderConfirmId - EstimatedPrice ############################################################################## GroupOrderConfirmRequestDefinition: description: '' properties: Orders: minItems: 1 type: array uniqueItems: true items: $ref: '#/definitions/OrderConfirmRequestDefinition' Type: description: | Indicates how Order Execution should treat this group of orders. minLength: 1 type: string enum: - NORMAL - OCO - BRK required: - Type - Orders type: object ############################################################################## GroupOrderConfirmResponseDefinition: description: '' type: array minItems: 1 uniqueItems: true items: $ref: '#/definitions/OrderConfirmResponseDefinition' ############################################################################## OrderResponseDefinition: description: '' type: object properties: Message: type: string description: Message string returned from orders service. OrderID: type: string description: Identifier for order. OrderStatus: type: string description: Returns the status of the order operation enum: - Ok - Failed required: - Message - OrderStatus ############################################################################## GroupOrderRequestDefinition: description: '' properties: Orders: minItems: 1 type: array uniqueItems: true items: $ref: '#/definitions/OrderRequestDefinition' Type: description: | Indicates how Order Execution should treat this group of orders. minLength: 1 type: string enum: - NORMAL - OCO - BRK required: - Type - Orders type: object ############################################################################## GroupOrderResponseDefinition: description: '' type: array minItems: 1 uniqueItems: true items: $ref: '#/definitions/OrderResponseDefinition' ############################################################################## ActivationTriggerDefinition: description: 'The trigger type allows you to specify the type of tick, number, and pattern of ticks that will trigger a specific row of an activation rule.' properties: Description: minLength: 1 type: string Key: minLength: 1 type: string description: | * STT - Single Trade Tick; One trade tick must print within your stop price to trigger your stop. * STTN - Single Trade Tick within NBBO; One trade tick within the National Best Bid or Offer must print within your stop price to trigger your stop. * SBA - Single Bid/Ask Tick; Buy/Cover Orders - One Ask tick must print within your stop price to trigger your stop. Sell/Short Orders - One Bid tick must print within your stop price to trigger your stop. * SAB - Single Ask/Bid Tick; Buy/Cover Orders - One Bid tick must print within your stop price to trigger your stop. Sell/Short Orders - One Ask tick must print within your stop price to trigger your stop. * DTT - Double Trade Tick; Two consecutive trade ticks must print within your stop price to trigger your stop. * DTTN - Double Trade Tick within NBBO; Two consecutive trade ticks within the National Best Bid or Offer must print within your stop price to trigger your stop. * DBA - Double Bid/Ask Tick; Buy/Cover Orders - Two consecutive Ask ticks must print within your stop price to trigger your stop. Sell/Short Orders - Two consecutive Bid ticks must print within your stop price to trigger your stop * DAB - Double Ask/Bid Tick; Buy/Cover Orders - Two consecutive Bid ticks must print within your stop price to trigger your stop. Sell/Short Orders - Two consecutive Ask ticks must print within your stop price to trigger your stop. * TTT - Twice Trade Tick; Two trade ticks must print within your stop price to trigger your stop. * TTTN - Twice Trade Tick; Two trade ticks within the National Best Bid or Offer must print within your stop price to trigger your stop. * TBA - Twice Bid/Ask Tick; Buy/Cover Orders - Two Ask ticks must print within your stop price to trigger your stop. Sell/Short Orders - Two Bid ticks must print within your stop price to trigger your stop. * TAB - Twice Ask/Bid Tick; Buy/Cover Orders - Two Bid ticks must print within your stop price to trigger your stop. Sell/Short Orders - Two Ask ticks must print within your stop price to trigger your stop. enum: - STT - STTN - SBA - SAB - DTT - DTTN - DBA - DAB - TTT - TTTN - TBA - TAB Name: minLength: 1 type: string required: - Description - Key - Name type: object ############################################################################## ExchangeDefinition: description: Returns a list of valid exchanges that a client can specify when posting an order. properties: AssetType: minLength: 1 type: string description: | Indicates the asset type of the exchange. * EQ - Equity * OP - Option enum: - EQ - OP Id: minLength: 1 type: string Name: minLength: 1 type: string required: - AssetType - Id - Name type: object ############################################################################## BarchartDefinition: description: Standard barchart data object for streaming barchart data with stream/barchart/... properties: Close: type: number description: Close price of current bar. DownTicks: type: number description: A trade made at a price less than the previous trade price or at a price equal to the previous trade price.. DownVolume: type: number description: The volume of securities with a current price that is below the previous day`s close High: type: number description: High price of current bar. Low: type: number description: Low price of current bar. Open: type: number description: Open price of current bar. OpenInterest: type: number description: Number of open contracts. Status: $ref: '#/definitions/StatusDefinition' TimeStamp: minLength: 1 type: string description: Epoch timestamp. TotalTicks: type: number description: Total number of ticks (upticks and downticks together). TotalVolume: type: number description: The total volume of all securities trading on a specific exchange. UnchangedTicks: type: number description: The number of securities with a current price that is the same as the previous day`s close UnchangedVolume: type: number description: The volume of securities with a current price that is the same as the previous day`s close. UpTicks: type: number description: 'A trade made at a price greater than the previous trade price, or at a price equal to the previous trade price.' UpVolume: type: number description: The volume of securities with a current price that is above the previous day`s close. required: - Close - DownTicks - DownVolume - High - Low - Open - Status - TimeStamp - TotalTicks - TotalVolume - UnchangedTicks - UnchangedVolume - UpTicks - UpVolume - OpenInterest type: object ############################################################################## StatusDefinition: description: Status value for Barcharts and Tickbars. Integer value represeting values through bit mappings properties: bit0: type: integer description: '`NEW`: Set on the first time the bar is sent' minimum: 0 maximum: 1 bit1: type: integer description: '`REAL_TIME_DATA`: Set when there is data in the bar and the data is being built in "real time"" from a trade' minimum: 0 maximum: 1 bit2: type: integer description: '`HISTORICAL_DATA`: Set when there is data in the bar and the data is historical data, or is built from historical data' minimum: 0 maximum: 1 bit3: type: integer description: '`STANDARD_CLOSE`: Set when the bar is closed "normally" (e.g. a 2 tick tickchart bar was closed because of the second tick, a 10-min barchart was closed due to time, etc.)' minimum: 0 maximum: 1 bit4: type: integer description: '`END_OF_SESSION_CLOSE`: Set when the bar was closed "prematurely" due to the end of the trading session and the particular bar type is not meant to span trading sessions' minimum: 0 maximum: 1 bit5: type: integer description: '`UPDATE_CORPACTION`: Set when there was an update due to corporate action' minimum: 0 maximum: 1 bit6: type: integer description: '`UPDATE_CORRECTION`: Set when there was an update due to a market correction' minimum: 0 maximum: 1 bit7: type: integer description: '`ANALYSIS_BAR`: Set when the bar should not be considered except for analysis purposes' minimum: 0 maximum: 1 bit8: type: integer description: '`EXTENDED_BAR`: Set when the bar is linked with an extended transaction linked with the primary stream (i.e. Conversions)' minimum: 0 maximum: 1 bit19: type: integer description: '`PREV_DAY_CORRECTION`: Set when there was an update due to prev.day correction' minimum: 0 maximum: 1 bit23: type: integer description: '`AFTER_MARKET_CORRECTION`: Set when there was an update due to an after market correction' minimum: 0 maximum: 1 bit24: type: integer description: '`PHANTOM_BAR`: Set when the bar is synthetic - thus created only to fill gaps' minimum: 0 maximum: 1 bit25: type: integer description: '`EMPTY_BAR`: Set when the bar is an empty bar – no market data for the bar period' minimum: 0 maximum: 1 bit26: type: integer description: '`BACKFILL_DATA`: Set when the bar is sent during backfill historical processing' minimum: 0 maximum: 1 bit27: type: integer description: '`ARCHIVE_DATA`: Set when the bar is sent during archive historical processing' minimum: 0 maximum: 1 bit28: type: integer description: '`GHOST_BAR`: Set when the bar is empty but specifically for the end session' minimum: 0 maximum: 1 bit29: type: integer description: '`END_OF_HISTORY_STREAM`: Set on a bar to convey to consumer that all historical bars have been sent. Historical bars are not guaranteed to be returned in order' minimum: 0 maximum: 1 required: - bit0 - bit1 - bit2 - bit3 - bit4 - bit5 - bit6 - bit7 - bit8 - bit19 - bit23 - bit24 - bit25 - bit26 - bit27 - bit28 - bit29 type: object ############################################################################## TickbarDefinition: description: Standard tickbar data object for streaming tick bars with stream/tickbars/... properties: Close: type: number description: Close price of current bar. Status: $ref: '#/definitions/StatusDefinition' TimeStamp: minLength: 1 type: string description: Epoch timestamp. TotalVolume: type: number description: The total volume of all securities trading on a specific exchange. required: - TimeStamp - Status - Close - TotalVolume type: object