{ "swagger": "2.0", "info": { "title": "Tradestation API", "description": "This document describes the resources that make up the official TradeStation\nAPI. If you have any problems or requests please contact [support](mailto:ClientExperience@tradestation.com).\n\nOverview\n========\n\nThe TradeStation API is reachable at the base-url:\n```\nhttps://api.tradestation.com/v2\n```\n\nCurrent Version\n---------------\n\nThe latest version is 20160101, but currently we are in transition, so by\ndefault all requests receive the 20101026 version for backwards compatibility.\n\nAlways explicitly request this version by adding the `APIVersion`\nquerystring parameter as shown below:\n\n```\nhttps://api.tradestation.com/v2/data/quote/msft?APIVersion=20160101\n```\n\nNote: This will ensure your application will not be broken when we deprecate\nthe 20101026 version in favor of 20160101 or newer versions.\n\nSIM vs LIVE\n-----------\n\nWe also offer a Simulator(SIM) API for \"Paper Trading\" that is identical\nto the Live API in all ways except it uses fake trading accounts seeded with\nfake money and orders are not actually executed - only simulated executions\noccur with instant \"fills\".\n\nTo access the SIM environment, you must change your base-url to:\n```\nhttps://sim-api.tradestation.com/v2\n```\n\n**WARNING:** TradeStation is not liable for mistakes made by applications\nthat allow users to switch between SIM and Live environments.\n\n### Why offer a Simulator?\n\nTransactional API calls such as Order Execution offers users or applications\nthe ability to experiment within a Simulated trading system so that real\naccounts and money are not affected and trades are not actually executed.\n\nOther potential use-cases:\n- Learning how to use applications via Paper Trading.\n- Exploring TradeStation API behavior without financial ramifications\n- Testing apps and websites before making them Live to customers\n- Enabling users to \"Try-before-they-buy\" with apps that use the TradeStation API\n- Hosting trading competitions or games\n\n\nHTTP Requests\n-------------\n\nAll API access is over HTTPS, and accessed from the https://api.tradestation.com.\nAll data is sent and received as JSON, with some limited support for XML.\n\nExample Request:\n```\ncurl -i https://api.tradestation.com/v2/data/quote/msft?APIVersion=20160101\n\nHTTP/1.1 200 OK\nCache-Control: private\nContent-Length: 1545\nContent-Type: application/default+json; charset=utf-8\nAccess-Control-Allow-Origin: *\nAPIVersion: 20160101\nDate: Wed, 30 Nov 2016 01:51:45 GMT\n\n[\n...json...\n]\n```\n\n### Common Conventions\n\n- Blank fields may either be included as null or omitted, so please support both.\n- All timestamps are returned in [Epoch time](https://en.wikipedia.org/wiki/Unix_time) format unless stated otherwise.\n\n\n\nHTTP Streaming\n--------------\n\nThe TradeStation API offers HTTP Streaming responses for some specialized\nresources including barcharts, quote changes, option chains, and option spread quotes (including single options). \nThese streams conform to RFC2616 for HTTP/1.1 Streaming with some slight\nmodifications.\n\n> The HTTP streaming mechanism keeps a request open indefinitely. It\n> never terminates the request or closes the connection, even after the\n> server pushes data to the client. This mechanism significantly\n> reduces the network latency because the client and the server do not\n> need to open and close the connection.\n>\n> The basic life cycle of an application using HTTP streaming is as\n> follows:\n>\n> 1. The client makes an initial request and then waits for a\n> response.\n>\n> 2. The server defers the response to a poll request until an update\n> is available, or until a particular status or timeout has\n> occurred.\n>\n> 3. Whenever an update is available, the server sends it back to the\n> client as a part of the response.\n>\n> 4. The data sent by the server does not terminate the request or the\n> connection. The server returns to step 3.\n>\n> The HTTP streaming mechanism is based on the capability of the server\n> to send several pieces of information in the same response, without\n> terminating the request or the connection.\n\nSource: [RFC6202, Page 7](https://tools.ietf.org/html/rfc6202#page-7).\n\nHTTP Streaming resources are identified under in this documentation as such,\nall other resources conform to the HTTP Request pattern instead.\n\nThe HTTP Streaming response is returned with the following headers:\n\n ```\n Transfer-Encoding: chunked\n Content-Type: application/vnd.tradestation.streams+json\n ```\n\nNote: The `Content-Length` header is typically omitted since the response\nbody size is unknown.\n\nStreams consist of a series of chunks that contain individual JSON objects\nto be parsed separately rather than as a whole response body.\n\nOne unique thing about TradeStation's HTTP Streams is they also can terminate\nunlike a canonical HTTP/1.1 Stream.\n\nStreams terminate with a non-JSON string prefixed with one of the following:\n\n - `END`\n - `ERROR`\n\nIn the case of `ERROR`, it will often be followed by an error message like:\n\n```\nERROR - A Timeout Occurred after waiting 15000ms\n```\n\nIn either case, the HTTP client must terminate the HTTP Stream and end the\nHTTP Request lifetime as a result of these messages. In the case of `ERROR`\nthe client application may add a delay before re-requesting the HTTP Stream.\n\n### How to handle HTTP Chunked Encoded Streams\n\nHealthy chunked-encoded streams emit variable length chunks that contain\nparsable JSON.\n\nFor example:\n```\nGET https://sim.api.tradestation.com/v2/stream/barchart/$DJI/1/Minute/12-26-2016/01-24-2017\n\nHTTP/1.1 200 OK\nDate: Wed, 14 Jun 2017 01:17:36 GMT\nContent-Type: application/vnd.tradestation.streams+json\nTransfer-Encoding: chunked\nConnection: keep-alive\nAccess-Control-Allow-Origin: *\nCache-Control: private\n\n114\n{\"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}\n\n\n112\n{\"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}\n\n\nEND\n```\n\nTypically this will stream forever, unless a network interruption or service\ndisruption occurs. It is up to the client to properly handle stream lifetime\nand connection closing.\n\n### How to parse JSON chunks\n\nIn order to process these chunks, API consumers should first read the\nresponse buffer, then de-chunk the plain-text strings, and finally identify\nnew JSON objects by applying tokenizing techniques to the resulting text\nstream using either a streaming JSON parser, Regex, a lexer/parser, or\nbrute-force string indexing logic.\n\nA simple but effective technique is after de-chunking to simply parse based\nupon the `\\n` (newline character) delimiter written to the end of each\nJSON object. However, a more robust solution is less likely to break later.\n\n#### Variable Length JSON Chunking\n\nAs a developer, be careful with how you parse HTTP Streams, because the\nAPI’s or intermediate proxies may chunk JSON objects many different ways.\n\n> Using HTTP streaming, several application\n> messages can be sent within a single HTTP response. The\n> separation of the response stream into application messages needs\n> to be performed at the application level and not at the HTTP\n> level. In particular, it is not possible to use the HTTP chunks\n> as application message delimiters, since intermediate proxies\n> might “re-chunk” the message stream (for example, by combining\n> different chunks into a longer one). This issue does not affect\n> the HTTP long polling technique, which provides a canonical\n> framing technique: each application message can be sent in a\n> different HTTP response.\n\nSource: [RFC6202, Section 3.2](https://tools.ietf.org/html/rfc6202#section-3.2)\n\nTranslation: Be prepared for JSON objects that span chunks. You may see\nchunks with varying numbers of JSON objects, including:\n\n- \"exactly 1\" JSON object per chunk\n- “at least 1” JSON object per chunk\n- 1 JSON object split across 2 or more chunks\n\nExample of 2 JSON objects in 1 chunk:\n```\nGET https://sim.api.tradestation.com/v2/stream/barchart/$DJI/1/Minute/12-26-2016/01-24-2017\n\nHTTP/1.1 200 OK\nDate: Wed, 14 Jun 2017 01:17:36 GMT\nContent-Type: application/vnd.tradestation.streams+json\nTransfer-Encoding: chunked\nConnection: keep-alive\nAccess-Control-Allow-Origin: *\nCache-Control: private\n\n22d\n{\"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}\n{\"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}\nEND\n```\n\nExample of 1 JSON objects split across 2 chunks:\n```\nGET https://sim.api.tradestation.com/v2/stream/barchart/$DJI/1/Minute/12-26-2016/01-24-2017\n\nHTTP/1.1 200 OK\nDate: Wed, 14 Jun 2017 01:17:36 GMT\nContent-Type: application/vnd.tradestation.streams+json\nTransfer-Encoding: chunked\nConnection: keep-alive\nAccess-Control-Allow-Origin: *\nCache-Control: private\n\n40\n{\"Close\":71.65,\"DownTicks\":45,\"DownVolume\":5406,\"High\":71.67,\"Lo\nC2\nw\":71.65,\"Open\":71.66,\"Status\":13,\"TimeStamp\":\"\\/Date(1497016260000)\\/\",\"TotalTicks\":77,\"TotalVolume\":17270,\"UnchangedTicks\":0,\"UnchangedVolume\":0,\"UpTicks\":32,\"UpVolume\":11864,\"OpenInterest\":0}\n\nEND\n```\n\nThis is allowed by the HTTP/1.1 specification, but can be confusing or lead\nto bugs in client applications if you try to depend parsing JSON along\nthe HTTP chunk-boundaries because even if it works during testing, later if\nusers connect from a different network, it may change the chunking behavior.\n\nFor example, if you are at a coffee shop with wifi which employs an\nHTTP Proxy, then it may buffer the stream and change the chunking boundary\nfrom 1 JSON object per chunk, to splitting each JSON object across 2 or 3.\n\nIn fact, the HTTP/1.1 spec clearly advises developers of proxies to always\n“re-chunk” HTTP Streams, so this is almost a guarantee to happen in the wild.\n\nHTTP Streaming API consumers should be prepared to support all variations.\n\n\n\n\nRate Limiting\n-------------\n\nThe TradeStation API Rate Limits on the number of requests a given user &\nclient can make to the API in order to ensure fairness between users and\nprevent abuse to our network. Each API Key is allocated quota settings upon\ncreation. These settings are applied on a per-user basis. If the quota is\nexceeded, an HTTP response of `403 Quota Exceeded` will be\nreturned. Quotas are reset on a 5-minute interval based on when the user\nissued the first request.\n\n## Resource Categories\n\nThe rate limit applies to the following resource-categories:\n\n| Resource-Category | Quota | Interval |\n| --------------------------------------------- | ----- | -------- |\n| Accounts | 250 | 5-minute |\n| Order Details | 250 | 5-minute |\n| Balances | 250 | 5-minute |\n| Positions | 250 | 5-minute |\n| Data Quotes | 250 | 5-minute |\n| Quote Change Stream | 500 | 5-minute |\n| Quote Snapshot Stream | 500 | 5-minute |\n| Barchart Stream | 500 | 5-minute |\n| TickBar Stream | 500 | 5-minute |\n\n\n\n## Intervals\n\nQuotas have \"Windows\" that last for a limited time interval\n(generally 5-minutes). Once the user has exceeded the maximum request count,\nall future requests will fail with a `403` error until the interval expires.\nRate Limit intervals do not slide based upon the number of requests, they are\nfixed at a point in time starting from the very first request for that\ncategory of resource. After the interval expires, the cycle will\nstart over at zero and the user can make more requests.\n\n### Example A\n\nA user logs into the TradeStation WebAPI with your application and issues a\nrequest to `/v2/EliteTrader/accounts`. As a result, the request\nquota is incremented by one for the `Accounts` resource-category. The user\nthen issues 250 more requests immediately to `/v2/EliteTrader/accounts`.\nThe last request fails with `403 Quota Exceeded`. All subsequent requests\ncontinue to fail until the 5-minute interval expires from the time of the\nvery first request.\n\n### Example B\n\nA user logs into the TradeStation WebAPI with your application and issues a\nrequest to `/v2/data/quote/IBM,NFLX,MSFT,AMZN,AAPL`. As a result, the\nrequest quota is incremented by one for the `Data Quotes`\nresource-category. The user then immediately issues the same request 250 more\ntimes. The last request fails with `403 Quota Exceeded`. All\nsubsequent requests continue to fail until the 5-minute interval expires\nfrom the time of the first request.\n\n**Example Throttled Request**\n```\nGET https://api.tradestation.com/v2/data/quotes/IBM,NFLX,MSFT,AMZN,AAPL HTTP/1.1\nHost: api.tradestation.com\nAuthorization: bearer eE45VkdQSnlBcmI0Q2RqTi82SFdMSVE0SXMyOFo5Z3dzVzdzdk\nAccept: application/json\n```\n**Example Failed Response**\n```\nHTTP/1.1 403 Quota Exceeded\nContent-Length: 15\nServer: Microsoft-IIS/7.5\nX-AspNet-Version: 4.0.30319\nDate: Tue, 06 Dec 2011 20:50:32 GMT\n\nQuota Exceeded\n```\n", "version": "20160101", "x-logo": { "url": "ts-logo.png" }, "contact": { "name": "TradeStation API Team", "email": "ClientExperience@tradestation.com", "url": "https://developer.tradestation.com/webapi" } }, "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\nand refresh tokens and is optimized for confidential clients. Since\nthis is a redirection-based flow, the client must be capable of\ninteracting with the resource owner’s user-agent (typically a web browser)\nand capable of receiving incoming requests (via redirection) from the\nauthorization server.\n\n#### Implementation Guide\n\nThe authorization code grant type allows the end users to authenticate\nwith TradeStation directly and authorize the Client application to make\ncalls on their behalf. Access Tokens obtained via the authorization code\nGrant Type can be refreshed, they will expire in 20 minutes of the time\nissued. These access tokens are accepted in the HTTP `Authorization` header.\n\n**Step-by-Step**\n\n**1. Redirect user for authentication/authorization**\n\nThe client application will route the end-user to our MFA (multi-factor\nauthentication) login page web page.\n\n*Authorize Uri:*\n- https://api.tradestation.com/v2/authorize\n\n*Required query string parameters:*\n- redirect_uri\n- client_id = the client application’s API key\n- response_type = code\n\n*Example Authorization Page Url:*\n```\nhttps://api.tradestation.com/v2/authorize/?redirect_uri=https://exampleclientapp.com/authcode.aspx&client_id=D7635234&response_type=code\n```\n\nThe URL will take you to a TradeStation login page.\n\n**2. Client receives authorization code**\n\nUpon successful authentication; The user agent(browser) will be redirected\nto the URL provided and include an Authorization Code in the query string.\n\n*Example Redirect:*\n```\nHTTP 301 Redirect\nRedirectURL = https://exampleclientapp.com/authcode.aspx?code=AFF345CD12B\n```\n\n*Note:*\n\n- This redirect URL can be anything that the user agent can understand.\nIn the case of an embedded browser it could be a URL to a native view,\ni.e.: device://viewname\n- The Authorization Code is only valid for 30 seconds\n\n**3. Exchange Authorization Code for Access Token**\n\nThe Client uses the Authorization Code to request an Access Token via the\n`/security/authorize` service method using the authorization_code grant type;\n\n*Required Header:*\n- Content-Type: application/x-www-form-urlencoded\n- Content-Length = Length of body information in UTF8\n\n*Required form parameters:*\n- grant_type = authorization_code\n- client_id = The client application’s API key\n- redirect_uri = The redirect uri used when obtaining the Authorization\nCode being provided\n- code = The Authorization Code value\n- client_secret = The secret for the client application’s API Key\n\n*Example Request*\n```\nPOST https://api.tradestation.com/v2/Security/Authorize HTTP/1.1\nContent-Type: application/x-www-form-urlencoded\nHost: api.tradestation.com\nContent-Length: 630\n\ngrant_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\n```\n\n*Example Response*\n```\nHTTP/1.1 200 OK\nCache-Control: private\nContent-Length: 927\nContent-Type: application/json; charset=utf-8\nServer: Microsoft-IIS/7.5\nX-AspNet-Version: 4.0.30319\nX-Powered-By: ASP.NET\nDate: Tue, 06 Dec 2011 20:50:32 GMT\n\n{\n\n \"refresh_token\": \"eGlhc2xvTTVJaEdXMWs4VjhraWx4bk5QMHJMaA==\",\n \"expires_in\": 1200,\n \"access_token\": \"eGlhc2xvozT2IxWnVITmdwGVFPQ==\",\n \"token_type\": \"AccessToken\",\n \"userid\": \"testUser\"\n}\n```\n", "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\n", "readaccount": "Requests access to view Brokerage Accounts belonging to the End-User\n", "trade": "Requests access to execute orders on behalf of the End-User\n" } }, "OAuth2-Refresh-Token": { "description": "After an access token has expired or it becomes invalid, \nthe Refresh token grant type can be used in order to obtain a new access token. \nRefresh tokens are valid indefinitely, unless the API key has been removed.\n\nA refresh token is specifically asigned for one API key and cannot be used to request new access tokens for a differet API key.\n\n\n*Required Header:*\n- Content-Type: application/x-www-form-urlencoded\n- Content-Length = Length of body information in UTF8\n\n*Required form parameters:*\n- grant_type: \"refresh_token\" is the expected value for this grant type\n- client_id: The client application’s API key \n- refresh_token: The Refresh Token value generated when to original Access token was requested.\n- client_secret: The secret for the client application’s API Key\n- response_type: \"token\" is the expected value for the response type.\n\n*Example Request*\n```\nPOST https://api.tradestation.com/v2/security/authorize HTTP/1.1\nContent-Type: application/x-www-form-urlencoded\nHost: api.tradestation.com\nContent-Length: 630\n\ngrant_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\n```\n\n*Example Response*\n```\nHTTP/1.1 200 OK\nCache-Control: private\nContent-Length: 927\nContent-Type: application/json; charset=utf-8\nServer: Microsoft-IIS/7.5 \nDate: Tue, 06 Dec 2011 20:50:32 GMT\n\n{\n\n \"access_token\":\"VUdLbE1RbTdCRUE4==\",\n \"expires_in\":1200,\n \"token_type\":\"AccessToken\",\n \"userid\":\"testUser\"\n}\n```\n\n\n*Possible Errors*\n- Invalid API Key: The API key sent as parameter does not match with the API key used to create the Refresh token.\n- API key failure: They API secret sent as parameter does not match with the API secret used to create the Refresh token.\n- Invalid refresh token: The refresh token used is not same that was sent to the user when the original access token was created.\n", "type": "oauth2", "flow": "application", "tokenUrl": "https://api.tradestation.com/v2/security/authorize", "scopes": { "marketdata": "Requests access to lookup or stream Market Data\n", "readaccount": "Requests access to view Brokerage Accounts belonging to the End-User\n", "trade": "Requests access to execute orders on behalf of the End-User\n" } } }, "tags": [ { "name": "marketdata", "description": "Snapshots and live streams of market data from supported exchanges.\n" }, { "name": "brokerage", "description": "Access to bank accounts, order transactions, and market positions for\nthe given user account.\n" }, { "name": "order-execution", "description": "Trading tools for order submission, cancellation, and pre-order confirmation.\n" } ], "paths": { "/v2/data/symbol/{symbol}": { "get": { "summary": "Get Symbol Info\n", "description": "Finds the given symbol and returns a collection of fields describing the\nsymbol, its origin exchange, and other pertinant information.\n", "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\"\n" } ], "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\n", "description": "Suggests symbols semantically based upon partial input of symbol name,\ncompany name, or description. Does not return Options symbols.\n", "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\"\n" } ], "parameters": [ { "name": "$top", "in": "query", "type": "integer", "description": "The top number of results to return.", "required": false }, { "name": "$filter", "in": "query", "type": "string", "description": "An OData filter to apply to the results. Supports the `eq` and `neq` filter opeators. E.g. `AAP?$filter=Category%20neq%20%27Stock%27`.\nValid values are: `Category` (`Stock`, `Index`, `Future`, `Forex`), `Country` (E.g. `United States`, `GB`) `Currency` (E.g. `USD`, `AUD`),\nand `Exchange` (E.g. `NYSE`).", "required": false }, { "name": "text", "in": "path", "type": "string", "description": "Symbol text for suggestion. Partial input of a symbol name, company name, or description.", "required": true } ], "responses": { "200": { "description": "Symbol Suggest", "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\n", "description": "Searches symbols based upon input criteria including Name, Category and\nCountry.\n", "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\"\n" } ], "parameters": [ { "name": "criteria", "in": "path", "type": "string", "description": "Criteria are represented as Key/value pairs (`&` separated):\n\n`N`: Name of Symbol. (Optional)\n\n`C`: Asset categories. (Optional) Possible values:\n - `Future` or `FU`\n - `FutureOption` or `FO`\n - `Stock` or `S` (Default)\n - `StockOption` or `SO` (If root is specified, default category)\n - `Index` or `IDX`\n - `CurrencyOption` or `CO`\n - `MutualFund` or `MF`\n - `MoneyMarketFund` or `MMF`\n - `IndexOption` or `IO`\n - `Bond` or `B`\n - `Forex` or `FX`\n\n`Cnt`: Country where the symbol is traded in. (Optional) Possible values:\n - `ALL` if not specified (Default)\n - `US`\n - `DE`\n - `CA`\n\n#### For Equities Lookups:\n\n`N`: partial/full symbol name, will return all symbols that contain the provided name value\n\n`Desc`: Name of the company\n\n`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:\n - `true`\n - `false` (Default)\n\n`Cnt`: Country where the symbol is traded in. (Optional) Possible values:\n - `ALL` if not specified (Default)\n - `US`\n - `DE`\n - `CA`\n\n#### For Options Lookups:\n(Category=StockOption, IndexOption, FutureOption or CurrencyOption)\n\n`R`: Symbol root. Required field, the symbol the option is a derivative of, this search will not return options based on a partial root.\n\n`Stk`: Number of strikes prices above and below the underlying price\n - Default value 3\n\n`Spl`: Strike price low\n\n`Sph`: Strike price high\n\n`Exd`: Number of expiration dates.\n - Default value 3\n\n`Edl`: Expiration date low, ex: 01-05-2011\n\n`Edh`: Expiration date high, ex: 01-20-2011\n\n`OT`: Option type. Possible values:\n - `Both` (Default)\n - `Call`\n - `Put`\n\n`FT`: Future type for FutureOptions. Possible values:\n - `Electronic` (Default)\n - `Pit`\n\n`ST`: Symbol type: Possible values:\n - `Both`\n - `Composite` (Default)\n - `Regional`\n\n#### For Futures Lookups:\n(Category = Future)\n\n`Desc`: Description of symbol traded\n\n`R`: Symbol root future trades\n\n`FT`: Futures type. Possible values:\n - `None`\n - `PIT`\n - `Electronic` (Default)\n - `Combined`\n\n`Cur`: Currency. Possible values:\n - `All`\n - `USD` (Default)\n - `AUD`\n - `CAD`\n - `CHF`\n - `DKK`\n - `EUR`\n - `DBP`\n - `HKD`\n - `JPY`\n - `NOK`\n - `NZD`\n - `SEK`\n - `SGD`\n\n`Exp`: whether to include expired contracts\n - `false` (Default)\n - `true`\n\n`Cnt`: Country where the symbol is traded in. (Optional) Possible values:\n - `ALL` if not specified (Default)\n - `US`\n - `DE`\n - `CA`\n\n#### For Forex Lookups:\n\n`N`: partial/full symbol name. Use all or null for a list of all forex symbols\n\n`Desc`: Description\n\nNote:\n - The exchange returned for all forex searches will be `FX`\n - The country returned for all forex searches will be `FOREX`\n", "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\n", "description": "Gets the latest Level 1 Quote for the given Symbol.\n", "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\"\n" } ], "parameters": [ { "name": "symbols", "in": "path", "description": "1 or more Symbol Names (comma-separated), limited to 50 symbols per request.", "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\n", "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.\n\nAn invalid symbol name will result in a response of this form - {\"Symbol\":\"BADEXAMPLESYMBOL\",\"Error\":\"FAILED, EX_INVALID_SYMBOL\"}\n\nIf the user is not entitled for the symbol requested, response will be of this form - {\"Symbol\":\"EXAMPLESYMBOL\",\"Error\":\"FAILED, EX_NOT_ENTITLED\"}\n", "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\"\n" } ], "produces": [ "application/vnd.tradestation.streams+json" ], "parameters": [ { "name": "symbols", "in": "path", "description": "1 or more Symbol Names (comma-separated), limited to 50 symbols per request.", "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\n", "description": "Streams the latest Quote for the given Symbols. Each chunk is a full quote object.\n\nAn invalid symbol name will result in a response of this form - {\"Symbol\":\"BADSYMBOLEXAMPLE\",\"Error\":\"FAILED, EX_INVALID_SYMBOL\"}\n\nIf the user is not entitled for the symbol requested, response will be of this form - {\"Symbol\":\"EXAMPLESYMBOL\",\"Error\":\"FAILED, EX_NOT_ENTITLED\"}\n", "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\"\n" } ], "produces": [ "application/vnd.tradestation.streams+json" ], "parameters": [ { "name": "symbols", "in": "path", "description": "1 or more Symbol Names (comma-separated), limited to 50 symbols per request.", "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\n", "description": "Streams barchart data starting from startDate, each bar filling quantity of unit.\n", "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\"\n" } ], "produces": [ "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", "USEQ24Hour", "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\n", "description": "Streams barchart data starting from startDate to end date, each bar filling interval of unit.\n", "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\"\n" } ], "produces": [ "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", "USEQ24Hour", "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\n", "description": "Streams barchart data starting from a number of bars back from last date, each bar filling interval of unit.\n", "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\"\n" } ], "produces": [ "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", "USEQ24Hour", "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\n", "description": "Streams barchart data starting from a number of days back from last date, each bar filling interval of unit.\n", "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\"\n" } ], "produces": [ "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", "USEQ24Hour", "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\n", "description": "Streams tick bars data for the regular session from a number of bars back, each bar returned separated by interval number of ticks.\n", "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\"\n" } ], "produces": [ "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\n", "description": "Gets a list of all Symbol Lists.\n", "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\"\n" } ], "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\n", "description": "Gets a specific Symbol List\n", "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\n", "description": "Gets the Symbols for a specific Symbol List.\n", "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\n", "description": "Returns all accounts for the given user.\n", "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\n", "description": "Returns the Balance for the given accounts.\n", "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\n", "description": "Returns the Positions for the given accounts.\n", "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.\n\nAvailable Fields:\n - `Symbol`: Symbol Name for Position\n" } ], "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\n", "description": "Returns the Orders for the given accounts sorted descending, most recent order first.\n\nNote: Intermediate order state changes are not available.\n", "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 90 days prior to the current date.\n", "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).\nNote 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.\n", "required": false }, { "name": "pageNum", "in": "query", "type": "string", "description": "Conveys the page number to return, given a set of orders and a page size.\nNote that an empty set will be returned for a pageNum/pageSize combination that doesn't contain orders.\n", "required": false } ], "responses": { "200": { "description": "Account Orders Response\n", "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\n", "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.\nThe fields that are returned in the response depend on the order type. The following shows the different fields that will be returned.\n\n**Base Confirmation** (All confirmations will have these fields)\n* Route\n* Duration\n* Account\n* SummaryMessage\n* OrderConfirmId\n\n**Equity Confirmation** (Base Confirmation fields + the following)\n* EstimatedPrice\n* EstimatedPriceDisplay\n* EstimatedCost\n* EstimatedCostDisplay\n* EstimatedCommission\n* EstimatedCommissionDisplay\n* DebitCreditEstimatedCost\n* DebitCreditEstimatedCostDisplay\n\n**Forex Confirmation** (Base Confirmation fields + the following)\n* BaseCurrency\n* CounterCurrency\n* InitialMarginDisplay\n\n**Futures Confirmation** (Base Confirmation fields + the following)\n* ProductCurrency\n* AccountCurrency\n* EstimatedCost\n* EstimatedPrice\n* EstimatedPriceDisplay\n* InitialMarginDisplay\n* EstimatedCommission\n* EstimatedCommissionDisplay\n", "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\n", "description": "Submits 1 or more orders. Request valid for Market, Limit, Stop Market, Stop Limit, Options and Order Sends Order (OSO) order types.\n", "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\n", "description": "Cancels an open order. You cannot cancel an order that has been filled.\n", "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\n", "description": "Updates (Cancels & Replaces) an open order. You cannot update an order that has been filled.\n\nRules:\n\n | Original order type | Fields to update | Can only change order type to |\n | -------------------------------- | -------------------------------- | ----------------------------- |\n | Limit Orders | Quantity, Stop Price | Market |\n | Stop Orders | Quantity, Stop Price | Market |\n | Stop Limit Orders | Quantity, Stop Price, Stop Limit | Market |\n | Stop Market Trailing Stop Orders | Quantity | Market |\n | Trailing Stop Orders | Offset type and value | Market |\n", "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\n", "description": "Returns estimated cost and commission information for a group of orders (OCO, BRK) without the orders actually being placed\n\n**Base Confirmation** (All confirmations will have these fields)\n* Route\n* Duration\n* Account\n* SummaryMessage\n* OrderConfirmId\n\n**Equity Confirmation** (Base Confirmation fields + the following)\n* EstimatedPrice\n* EstimatedPriceDisplay\n* EstimatedCost\n* EstimatedCostDisplay\n* EstimatedCommission\n* EstimatedCommissionDisplay\n\n**Forex Confirmation** (Base Confirmation fields + the following)\n* BaseCurrency\n* CounterCurrency\n* InitialMarginDisplay\n\n**Futures Confirmation** (Base Confirmation fields + the following)\n* ProductCurrency\n* AccountCurrency\n* EstimatedCost\n* EstimatedPrice\n* EstimatedPriceDisplay\n* InitialMarginDisplay\n* EstimatedCommission\n* EstimatedCommissionDisplay\n", "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\n", "description": "Submits a group order such as Bracket and OCO Orders.\n\n#### Order Cancels Order (OCO)\nAn OCO order is a group of orders whereby if one of the orders is filled\nor partially-filled, then all of the other orders in the group are\ncancelled.\n\n#### Bracket OCO Orders\nA bracket order is a special instance of an OCO (Order Cancel Order).\nBracket orders are used to exit an existing position. They are designed\nto limit loss and lock in profit by “bracketing” an order with a\nsimultaneous stop and limit order.\n\nBracket orders are limited so that the orders are all for the same\nsymbol and are on the same side of the market (either all to sell or\nall to cover), and they are restricted to closing transactions.\n\nThe reason that they follow these rules is because the orders need to be\nable to auto decrement when a partial fill occurs with one of the orders.\nFor example, if the customer has a sell limit order for 1000 shares and\na sell stop order for 1000 shares, and the limit order is partially\nfilled for 500 shares, then the customer would want the stop to remain\nopen, but it should automatically decrement the order to 500 shares to\nmatch the remaining open position.\n\n### Errors\nWhen a submitted order fails, it can be seen in two different ways:\n-\tImmediately rejected during submit to the Orders API with a 400 HTTP status code.\n-\tAccepted 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\n\n#### NOTE\nWhen 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.\n\nIn order to prevent errors, please validate the data on the client side.\n", "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": "\nRequest Available Activation Triggers\n", "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.\n", "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\n", "description": "Returns a list of valid exchanges that a client can specify when posting an order.\n", "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": { "properties": { "TraceId": { "type": "string", "format": "uuid" }, "StatusCode": { "type": "integer", "format": "int32" }, "Message": { "type": "string" } }, "type": "object" }, "BarchartError400": { "properties": { "StatusCode": { "type": "integer", "format": "int32" }, "Message": { "type": "string", "enum": [ "Not a valid date.", "Not a valid number." ] } } }, "BarchartError404": { "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": { "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": { "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": { "type": "string", "description": "Displays the full name of the symbol." }, "DisplayType": { "type": "number", "description": "Symbol's price display type based on the following list:\n\n* `0` \"Automatic\" Not used\n* `1` 0 Decimals => 1\n* `2` 1 Decimals => .1\n* `3` 2 Decimals => .01\n* `4` 3 Decimals => .001\n* `5` 4 Decimals => .0001\n* `6` 5 Decimals => .00001\n* `7` Simplest Fraction\n* `8` 1/2-Halves => .5\n* `9` 1/4-Fourths => .25\n* `10` 1/8-Eights => .125\n* `11` 1/16-Sixteenths => .0625\n* `12` 1/32-ThirtySeconds => .03125\n* `13` 1/64-SixtyFourths => .015625\n* `14` 1/128-OneTwentyEigths => .0078125\n* `15` 1/256-TwoFiftySixths => .003906250\n* `16` 10ths and Quarters => .025\n* `17` 32nds and Halves => .015625\n* `18` 32nds and Quarters => .0078125\n* `19` 32nds and Eights => .00390625\n* `20` 32nds and Tenths => .003125\n* `21` 64ths and Halves => .0078125\n* `22` 64ths and Tenths => .0015625\n* `23` 6 Decimals => .000001\n" }, "Error": { "type": "string", "description": "Element that references error." }, "Exchange": { "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": { "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.\n* W - Weekly\n* M - Monthly\n* Q - Quartely\n* E - End of the month\n* \"\" - The term not be identified\n" }, "FutureType": { "type": "string", "description": "Displays the type of future contract the symbol represents" }, "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": { "type": "string", "description": "A unique series of letters assigned to a security for trading purposes." }, "OptionType": { "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": { "type": "string", "description": "The Symbol root." }, "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." } }, "type": "object" }, "SymbolSuggestDefinition": { "description": "", "items": { "properties": { "Category": { "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": { "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": { "type": "string", "description": "Displays the full name of the symbol." }, "DisplayType": { "type": "number", "description": "Symbol's price display type based on the following list:\n\n* `0` \"Automatic\" => .00 (should be handled as 2 decimals)\n* `1` 0 Decimals => 1\n* `2` 1 Decimals => .1\n* `3` 2 Decimals => .01\n* `4` 3 Decimals => .001\n* `5` 4 Decimals => .0001\n* `6` 5 Decimals => .00001\n* `7` Simplest Fraction\n* `8` 1/2-Halves => .5\n* `9` 1/4-Fourths => .25\n* `10` 1/8-Eights => .125\n* `11` 1/16-Sixteenths => .0625\n* `12` 1/32-ThirtySeconds => .03125\n* `13` 1/64-SixtyFourths => .015625\n* `14` 1/128-OneTwentyEigths => .0078125\n* `15` 1/256-TwoFiftySixths => .003906250\n* `16` 10ths and Quarters => .025\n* `17` 32nds and Halves => .015625\n* `18` 32nds and Quarters => .0078125\n* `19` 32nds and Eights => .00390625\n* `20` 32nds and Tenths => .003125\n* `21` 64ths and Halves => .0078125\n* `22` 64ths and Tenths => .0015625\n* `23` 6 Decimals => .000001\n" }, "Error": { "type": "string", "description": "Element that references error." }, "Exchange": { "type": "string", "description": "Name of exchange where this symbol is traded in." }, "ExchangeID": { "type": "number", "description": "A unique numerical identifier for the Exchange." }, "ExpirationDate": { "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.\n* W - Weekly\n* M - Monthly\n* Q - Quartely\n* E - End of the month\n* \"\" - The term not be identified\n" }, "FutureType": { "type": "string", "description": "Displays the type of future contract the symbol represents." }, "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": { "type": "string", "description": "A unique series of letters assigned to a security for trading purposes." }, "OptionType": { "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": { "type": "string", "description": "The Symbol root." }, "StrikePrice": { "type": "number", "description": "Displays strike price of an options contract; For Options symbols only." } }, "type": "object" }, "minItems": 0, "type": "array", "uniqueItems": true }, "SymbolSearchDefinition": { "description": "", "items": { "properties": { "Category": { "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": { "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": { "type": "string", "description": "Displays the full name of the symbol." }, "DisplayType": { "type": "number", "description": "Symbol's price display type based on the following list:\n\n* `0` \"Automatic\" Not used\n* `1` 0 Decimals => 1\n* `2` 1 Decimals => .1\n* `3` 2 Decimals => .01\n* `4` 3 Decimals => .001\n* `5` 4 Decimals => .0001\n* `6` 5 Decimals => .00001\n* `7` Simplest Fraction\n* `8` 1/2-Halves => .5\n* `9` 1/4-Fourths => .25\n* `10` 1/8-Eights => .125\n* `11` 1/16-Sixteenths => .0625\n* `12` 1/32-ThirtySeconds => .03125\n* `13` 1/64-SixtyFourths => .015625\n* `14` 1/128-OneTwentyEigths => .0078125\n* `15` 1/256-TwoFiftySixths => .003906250\n* `16` 10ths and Quarters => .025\n* `17` 32nds and Halves => .015625\n* `18` 32nds and Quarters => .0078125\n* `19` 32nds and Eights => .00390625\n* `20` 32nds and Tenths => .003125\n* `21` 64ths and Halves => .0078125\n* `22` 64ths and Tenths => .0015625\n* `23` 6 Decimals => .000001\n" }, "Error": { "type": "string", "description": "Element that references error." }, "Exchange": { "type": "string", "description": "Name of exchange where this symbol is traded in." }, "ExchangeID": { "type": "number", "description": "A unique numerical identifier for the Exchange." }, "ExpirationDate": { "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.\n* W - Weekly\n* M - Monthly\n* Q - Quartely\n* E - End of the month\n* \"\" - The term not be identified\n" }, "FutureType": { "type": "string", "description": "Displays the type of future contract the symbol represents." }, "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": { "type": "string", "description": "A unique series of letters assigned to a security for trading purposes." }, "OptionType": { "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": { "type": "string", "description": "The Symbol root." }, "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." } }, "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": { "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": { "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": { "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": { "type": "string", "description": "Daily running close price formatted for display." }, "CountryCode": { "type": "string", "description": "The country of the exchange where the symbol is listed." }, "Currency": { "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": { "type": "string", "description": "The data quote feed provider." }, "Description": { "type": "string", "description": "Displays the full name of the symbol." }, "DisplayType": { "type": "number", "description": "Symbol's price display type based on the following list:\n\n* `0` \"Automatic\" Not used\n* `1` 0 Decimals => 1\n* `2` 1 Decimals => .1\n* `3` 2 Decimals => .01\n* `4` 3 Decimals => .001\n* `5` 4 Decimals => .0001\n* `6` 5 Decimals => .00001\n* `7` Simplest Fraction\n* `8` 1/2-Halves => .5\n* `9` 1/4-Fourths => .25\n* `10` 1/8-Eights => .125\n* `11` 1/16-Sixteenths => .0625\n* `12` 1/32-ThirtySeconds => .03125\n* `13` 1/64-SixtyFourths => .015625\n* `14` 1/128-OneTwentyEigths => .0078125\n* `15` 1/256-TwoFiftySixths => .003906250\n* `16` 10ths and Quarters => .025\n* `17` 32nds and Halves => .015625\n* `18` 32nds and Quarters => .0078125\n* `19` 32nds and Eights => .00390625\n* `20` 32nds and Tenths => .003125\n* `21` 64ths and Halves => .0078125\n* `22` 64ths and Tenths => .0015625\n* `23` 6 Decimals => .000001\n" }, "Error": { "type": "string", "description": "Error message received from exchange or Tradestation." }, "Exchange": { "type": "string", "description": "Name of exchange where this symbol is traded in." }, "ExpirationDate": { "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": { "type": "string", "description": "High52Week price formatted for display." }, "High52WeekTimeStamp": { "type": "string", "description": "Date and time of the highest price in the past 52 week." }, "HighPriceDisplay": { "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": { "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": { "type": "string", "description": "Low52Week price formatted for display." }, "Low52WeekTimeStamp": { "type": "string", "description": "Date and time of the lowest price of the past 52 weeks." }, "LowPriceDisplay": { "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": { "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": { "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": { "type": "string", "description": "StrikePrice formatted for display." }, "Symbol": { "type": "string", "description": "The name identifying the financial instrument for which the data is displayed." }, "SymbolRoot": { "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": { "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.\n" }, "VWAPDisplay": { "type": "string", "description": "VWAP formatted for display." } }, "type": "object" }, "minItems": 1, "type": "array", "uniqueItems": true }, "SymbolListsDefinition": { "description": "", "items": { "$ref": "#/definitions/SymbolListDefinition" }, "minItems": 1, "type": "array", "uniqueItems": true }, "SymbolListDefinition": { "description": "", "properties": { "Category": { "type": "string", "description": "Second Level of Symbol List Hierarchy." }, "ID": { "type": "string", "description": "Unique symbol list identifier." }, "Name": { "type": "string", "description": "Symbol List Name." }, "Path": { "type": "string", "description": "Full hierarchy path including name." }, "RootCategory": { "type": "string", "description": "First Level of Symbol List Hierarchy." }, "Subcategory": { "type": "string", "description": "Thrid Level of Symbol List Hierarchy." } }, "type": "object" }, "SymbolListSymbolsDefinition": { "description": "", "items": { "properties": { "Description": { "type": "string", "description": "Displays the full name of the symbol." }, "Exchange": { "type": "string", "description": "Name of exchange where this symbol is traded in." }, "Name": { "type": "string", "description": "A unique series of letters assigned to a security for trading purposes." } }, "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": { "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": { "type": "string", "description": "Account Name." }, "Type": { "type": "string", "description": "Type of the account:\n\n* `C` Cash\n* `M` Margin\n* `F` Futures\n* `D` DVP\n" }, "TypeDescription": { "type": "string", "description": "Name of the type of the account.", "enum": [ "Cash", "Margin", "DVP", "Futures" ] }, "Status": { "type": "string", "description": "Status of a specific account.\n* A - Active\n* X - Closed\n* C - Closing Transaction Only\n* F - Margin Call - Closing Transactions Only\n* I - Inactive\n* L - Liquidating Transactions Only\n* R - Restricted\n* D - 90 Day Restriction-Closing Transaction Only\n", "enum": [ "A", "X", "C", "F", "I", "L", "R", "D" ] }, "StatusDescription": { "type": "string", "description": "String value for Status attribute." } }, "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 (Deprecated)": { "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." } } }, "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.", "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": { "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." } } }, "minItems": 1, "type": "array", "uniqueItems": true }, "DisplayName": { "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": { "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\n* Level 0 - No options trading allowed.\n* Level 1 - Writing of Covered Calls, Buying Protective Puts.\n* Level 2 - Level 1 + Buying Calls, Buying Puts, Writing Covered Puts.\n* Level 3 - level 2+ Stock Option Spreads, Index Option Spreads, Butterfly Spreads, Condor Spreads, Iron Butterfly Spreads, Iron Condor Spreads.\n* Level 4 - Level 3 + Writing of Naked Puts (Stock Options).\n* Level 5 - Level 4 + Writing of Naked Puts (Index Options), Writing of Naked Calls (Stock Options), Writing of Naked Calls (Index Options).\n", "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.\n", "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) The cost used to calculate today's P/L.", "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": { "type": "string", "description": "Status of a specific account.\n* A - Active\n* X - Closed\n* C - Closing Transaction Only\n* F - Margin Call - Closing Transactions Only\n* I - Inactive\n* L - Liquidating Transactions Only\n* R - Restricted\n* D - 90 Day Restriction-Closing Transaction Only\n", "enum": [ "A", "X", "C", "F", "I", "L", "R", "D" ] }, "StatusDescription": { "type": "string", "description": "String value for Status attribute." }, "TodayRealTimeTradeEquity": { "description": "(Futures) The unrealized P/L for today. Unrealized P/L - BODOpenTradeEquity", "type": "number" }, "Type": { "type": "string", "description": "The type of the account.\n* C - Cash\n* M - Margin\n* D - DVP\n* F - Futures\n", "enum": [ "C", "M", "D", "F" ] }, "TypeDescription": { "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" } }, "type": "object" }, "minItems": 1, "type": "array", "uniqueItems": true }, "AccountPositionsDefinition": { "description": "", "items": { "properties": { "AccountID": { "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": { "type": "string", "description": "Formatted text representation of the AskPrice for easy display" }, "AssetType": { "type": "string", "description": "Indicates the asset type of the position\n* EQ - Equity\n* OP - Option\n* Fu - Future\n", "enum": [ "EQ", "Op", "Fu" ] }, "AveragePrice": { "type": "number", "description": "Average price of all positions for the current symbol." }, "AveragePriceDisplay": { "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": { "type": "string", "description": "Formatted text representation of the BidPrice for easy display" }, "BigPointValue": { "type": "number", "description": "Dollar value for a one point movement." }, "ContractExpireDate": { "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": { "type": "string", "description": "The country of the exchange where the symbol is listed." }, "Currency": { "type": "string", "description": "The base currency of the symbol." }, "DayTradeMargin": { "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": { "type": "string", "description": "Displays the full name of the symbol." }, "DisplayName": { "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": { "type": "string", "description": "Formatted text representation of the LastPrice for easy display" }, "LongShort": { "type": "string", "description": "Specifies if the position is Long or Short.\n* 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.\n* 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.\n", "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.\n\nThe 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.\n" }, "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": "DO NOT USE - Marked for deprecation." }, "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": { "type": "string", "description": "Formatted text representation of the StrikePrice for easy display" }, "Symbol": { "type": "string", "description": "Symbol of the current position." }, "TimeStamp": { "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 symbol currency of the position held." }, "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." } }, "type": "object" }, "minItems": 1, "type": "array", "uniqueItems": true }, "AccountOrdersDefinition": { "description": "", "items": { "properties": { "AccountID": { "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": { "type": "string", "description": "* FU = Future\n* EQ = Equity\n* OP = Stock Option\n* FX = Forex\n", "enum": [ "FU", "EQ", "OP", "FX" ] }, "CommissionFee": { "type": "number", "description": "Commission paid in an order." }, "ContractExpireDate": { "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": { "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": { "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": { "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": { "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": { "type": "string", "description": "String value for LimitPrice attribute." }, "Month": { "type": "number", "description": "Expiration month for options or futures." }, "OpenOrClose": { "type": "string", "description": "Identifies whether the order is an Opening or Closing trade." }, "OrderID": { "type": "number", "description": "ID of the current order." }, "OrderType": { "type": "string", "description": "Identifies the order type of the order.\n", "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": { "type": "string", "description": "Identifies whether the order is a buy or sell.\n\n* `T` Sell Short\n* `C` Buy to Cover\n* `B` Buy\n* `S` Sell\n", "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": { "type": "string", "description": "Symbol to trade." }, "TimeExecuted": { "type": "string", "description": "The time the order was filled or canceled." }, "Type": { "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." } } }, "minItems": 1, "type": "array", "uniqueItems": true }, "LimitPrice": { "type": "number", "description": "The limit price for Limit and Stop Limit orders." }, "LimitPriceText": { "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.\n" }, "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": { "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": { "type": "string", "description": "* OPN, ACK, UCN = Open Orders -- New order request pending, cancel request pending.\n* FLL, FLP = Filled Orders -- Partially-Filled and remaining canceled.\n* FPR = Partially Filled Orders.\n* OUT = Canceled Orders.\n* REJ, TSC = Rejected Orders -- It is an internal server(s) unsolicited cancel, not final status.\n* EXP = Expired Orders.\n* BRO = Broken Orders -- Not necessarily the order’s final status since later it may be reinstated to open.\n* CAN = Exch. Canceled Orders.\n* LAT = Too Late Orders -- Not the order’s final status.\n* DON = Queued Orders.\n", "enum": [ "OPN", "ACK", "UCN", "FLL", "FLP", "FPR", "OUT", "REJ", "TSC", "Exp", "BRO", "CAN", "LAT", "DON" ] }, "StatusDescription": { "description": "Description for Status attribute.", "type": "string" }, "StopPrice": { "type": "number", "description": "The stop price for stop orders." }, "StopPriceText": { "type": "string", "description": "String value for StopPrice attribute." }, "Symbol": { "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.\n" }, "TimeStamp": { "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": { "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." } }, "type": "object" }, "minItems": 1, "type": "array", "uniqueItems": true }, "OrderConfirmRequestDefinition": { "properties": { "AccountKey": { "description": "Must be a valid Account Key for that user and Asset Type\n", "type": "string" }, "AdvancedOptions": { "$ref": "#/definitions/AdvancedOptionsDefinition" }, "AssetType": { "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\n* DAY - Day, valid until the end of the regular trading session.\n* DYP - Day Plus; valid until the end of the extended trading session\n* GTC - Good till canceled\n* GCP - Good till canceled plus\n* GTD - Good through date\n* GDP - Good through date plus\n* OPG - At the opening; only valid for listed stocks at the opening session Price\n* CLO - On Close; orders that target the closing session of an exchange.\n* IOC - Immediate or Cancel; filled immediately or canceled, partial fills are accepted\n* FOK - Fill or Kill; orders are filled entirely or canceled, partial fills are not accepted\n* 1 or 1 MIN - 1 minute; expires after the 1 minute\n* 3 or 3 MIN - 3 minutes; expires after the 3 minutes\n* 5 or 5 MIN - 5 minutes; expires after the 5 minutes\n" }, "GTDDate": { "description": "Date that Order is valid through. Input Format: MM/DD/YYYY\nRequired for orders with Duration = GTD.\n", "maxLength": 10, "type": "string", "format": "mmddyyyy" }, "LimitPrice": { "type": "string" }, "StopPrice": { "type": "string" }, "OrderType": { "type": "string", "enum": [ "Limit", "Market", "StopLimit", "StopMarket" ] }, "Quantity": { "type": "string" }, "Route": { "type": "string", "description": "The route of the order. For Stocks and Options, Route value will default to `Intelligent` if no value is set.\nMust be UPPERCASE. Routes can be obtained from [Retrieve Available Exchanges](#operation/getExchanges).\n" }, "Symbol": { "description": "Must be UPPERCASE", "type": "string" }, "TradeAction": { "type": "string", "description": "Conveys the intent of the trade\n* BUY - `equities` and `futures`\n* SELL - `equities` and `futures`\n* BUYTOCOVER - `equities`\n* SELLSHORT - `equities`\n* BUYTOOPEN - `options`\n* BUYTOCLOSE - `options`\n* SELLTOOPEN - `options`\n* SELLTOCLOSE - `options`\n", "enum": [ "BUY", "SELL", "BUYTOCOVER", "SELLSHORT", "BUYTOOPEN", "BUYTOCLOSE", "SELLTOOPEN", "SELLTOCLOSE" ] }, "OSOs": { "items": { "type": "object", "properties": { "Type": { "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", "type": "string" }, "Quantity": { "type": "string" }, "TradeAction": { "type": "string", "enum": [ "BUY", "SELL", "BUYTOCOVER", "SELLSHORT", "BUYTOOPEN", "BUYTOCLOSE", "SELLTOOPEN", "SELLTOCLOSE" ], "description": "Conveys the intent of the trade\n* BUY - equity and futures trades\n* SELL - equity and futures trades\n* BUYTOCOVER - equity trade to close a short position\n* SELLSHORT - equity trade to open a short position\n* BUYTOOPEN - option trades\n* BUYTOCLOSE - option trades\n* SELLTOOPEN - option trades\n* SELLTOCLOSE - option trades\n" } } }, "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\n", "type": "string" }, "AdvancedOptions": { "$ref": "#/definitions/AdvancedOptionsDefinition" }, "AssetType": { "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\n* DAY - Day, valid until the end of the regular trading session.\n* DYP - Day Plus; valid until the end of the extended trading session\n* GTC - Good till canceled\n* GCP - Good till canceled plus\n* GTD - Good through date\n* GDP - Good through date plus\n* OPG - At the opening; only valid for listed stocks at the opening session Price\n* CLO - On Close; orders that target the closing session of an exchange.\n* IOC - Immediate or Cancel; filled immediately or canceled, partial fills are accepted\n* FOK - Fill or Kill; orders are filled entirely or canceled, partial fills are not accepted\n* 1 or 1 MIN - 1 minute; expires after the 1 minute\n* 3 or 3 MIN - 3 minutes; expires after the 3 minutes\n* 5 or 5 MIN - 5 minutes; expires after the 5 minutes\n" }, "GTDDate": { "description": "Date that Order is valid through. Input Format: MM/DD/YYYY\nRequired for orders with Duration = GTD.\n", "maxLength": 10, "type": "string", "format": "mmddyyyy" }, "LimitPrice": { "type": "string" }, "StopPrice": { "type": "string" }, "OrderConfirmId": { "description": "A unique identifier regarding an order used to prevent duplicates.\n\nMust be unique per API key, per order, per user.\n", "maxLength": 22, "type": "string" }, "OrderType": { "type": "string", "enum": [ "Limit", "Market", "StopLimit", "StopMarket" ] }, "Quantity": { "type": "string" }, "Route": { "type": "string", "description": "The route of the order. For Stocks and Options, Route value will default to `Intelligent` if no value is set.\nMust be UPPERCASE. Routes can be obtained from [Retrieve Available Exchanges](#operation/getExchanges).\n" }, "Symbol": { "description": "Must be UPPERCASE", "type": "string" }, "TradeAction": { "type": "string", "description": "Conveys the intent of the trade\n* BUY - `equities` and `futures`\n* SELL - `equities` and `futures`\n* BUYTOCOVER - `equities`\n* SELLSHORT - `equities`\n* BUYTOOPEN - `options`\n* BUYTOCLOSE - `options`\n* SELLTOOPEN - `options`\n* SELLTOCLOSE - `options`\n", "enum": [ "BUY", "SELL", "BUYTOCOVER", "SELLSHORT", "BUYTOOPEN", "BUYTOCLOSE", "SELLTOOPEN", "SELLTOCLOSE" ] }, "OSOs": { "items": { "type": "object", "properties": { "Type": { "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", "type": "string" }, "Quantity": { "type": "string" }, "TradeAction": { "type": "string", "enum": [ "BUY", "SELL", "BUYTOCOVER", "SELLSHORT", "BUYTOOPEN", "BUYTOCLOSE", "SELLTOOPEN", "SELLTOCLOSE" ], "description": "Conveys the intent of the trade\n* BUY - equity and futures trades\n* SELL - equity and futures trades\n* BUYTOCOVER - equity trade to close a short position\n* SELLSHORT - equity trade to open a short position\n* BUYTOOPEN - option trades\n* BUYTOCLOSE - option trades\n* SELLTOOPEN - option trades\n* SELLTOCLOSE - option trades\n" } } }, "minItems": 1, "type": "array", "uniqueItems": true } }, "required": [ "AssetType", "Symbol", "Quantity", "OrderType", "Duration", "AccountKey", "TradeAction" ], "type": "object" }, "CancelReplaceDefinition": { "description": "", "properties": { "LimitPrice": { "type": "string" }, "StopPrice": { "type": "string" }, "OrderType": { "type": "string" }, "Quantity": { "type": "string" }, "Symbol": { "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.\nCannot be added if original order did not have ShowOnlyQuantity.\n", "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`.\n" }, "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.\n", "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`.\n" }, "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.\n", "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.\n", "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.\n", "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.\n", "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\"\n", "type": "string", "enum": [ "Price" ] }, "Symbol": { "description": "Symbol that the rule is based on\n", "type": "string" }, "Predicate": { "description": "The predicate comparison for the market rule type. E.g. Lt (less than).\n", "type": "string", "enum": [ "Lt", "Lte", "Gt", "Gte" ] }, "TriggerKey": { "description": "The ticks behavior for the activation rule.\n", "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\n", "type": "string" }, "LogicOperator": { "description": "Relation with the previous activation rule when given a list of MarketActivationRules. Ignored for the first MarketActivationRule.\n", "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\n", "type": "string" } } }, "TrailingStopDefinition": { "description": "Trailing Stop offset; amount or percent", "type": "object", "properties": { "Amount": { "description": "Currency Offset from current price.\nNote: Mutually exclusive with Percent.\n", "type": "number" }, "Percent": { "description": "Percentage offset from current price.\nNote: Mutually exclusive with Amount.\n", "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" } } }, "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.\n", "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" ] } } }, "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.\n", "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": { "type": "string" }, "Key": { "type": "string", "description": "* STT - Single Trade Tick; One trade tick must print within your stop price to trigger your stop.\n* 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.\n* 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.\n* 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.\n* DTT - Double Trade Tick; Two consecutive trade ticks must print within your stop price to trigger your stop.\n* 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.\n* 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\n* 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.\n* TTT - Twice Trade Tick; Two trade ticks must print within your stop price to trigger your stop.\n* TTTN - Twice Trade Tick; Two trade ticks within the National Best Bid or Offer must print within your stop price to trigger your stop.\n* 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.\n* 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.\n", "enum": [ "STT", "STTN", "SBA", "SAB", "DTT", "DTTN", "DBA", "DAB", "TTT", "TTTN", "TBA", "TAB" ] }, "Name": { "type": "string" } }, "type": "object" }, "ExchangeDefinition": { "description": "Returns a list of valid exchanges that a client can specify when posting an order.", "properties": { "AssetType": { "type": "string", "description": "Indicates the asset type of the exchange.\n* EQ - Equity\n* OP - Option\n", "enum": [ "EQ", "OP" ] }, "Id": { "type": "string" }, "Name": { "type": "string" } }, "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": { "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 (Deprecated)": { "type": "number", "description": "This field is deprecated, and its value will always be zero." }, "UnchangedVolume (Deprecated)": { "type": "number", "description": "This field is deprecated, and its value will always be zero." }, "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." } }, "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 } }, "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": { "type": "string", "description": "Epoch timestamp." }, "TotalVolume": { "type": "number", "description": "The total volume of shares or contracts." } }, "type": "object" } } }