Download OpenAPI specification:Download
For more information on authorization and gaining an access/refresh token, please visit: Authentication.
Get Bars
Fetches marketdata bars for the given symbol, interval, and timeframe. The maximum amount of intraday bars a user can fetch is 57,600 per request. This is calculated either by the amount of barsback or bars within a timeframe requested.
path Parameters
symbol required | string Example: MSFT The valid symbol string. |
query Parameters
interval | string Example: interval=1 Default: |
unit | string Example: unit=Daily Default: |
barsback | string Example: barsback=5 Default: |
firstdate | string Example: firstdate=2020-12-05T21:00:00Z Does not have a default value. The first date formatted as |
lastdate | string Example: lastdate=2020-12-05T21:00:00Z Defaults to current timestamp. The last date formatted as |
sessiontemplate | string 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. Valid values are:
|
startdate | string Deprecated Example: startdate=2020-12-05T21:00:00Z Defaults to current timestamp. The last date formatted as |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/barcharts/MSFT' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Bars": [
- {
- "High": "218.32",
- "Low": "212.42",
- "Open": "214.02",
- "Close": "216.39",
- "TimeStamp": "2020-11-04T21:00:00Z",
- "TotalVolume": "42311777",
- "DownTicks": 231021,
- "DownVolume": 19575455,
- "OpenInterest": "0",
- "IsRealtime": false,
- "IsEndOfHistory": false,
- "TotalTicks": 460552,
- "UnchangedTicks": 0,
- "UnchangedVolume": 0,
- "UpTicks": 229531,
- "UpVolume": 22736321,
- "Epoch": 1604523600000,
- "BarStatus": "Closed"
}, - {
- "High": "224.12",
- "Low": "221.15",
- "Open": "222.04",
- "Close": "223.29",
- "TimeStamp": "2020-11-05T21:00:00Z",
- "TotalVolume": "36080137",
- "DownTicks": 183013,
- "DownVolume": 17344601,
- "OpenInterest": "0",
- "IsRealtime": false,
- "IsEndOfHistory": false,
- "TotalTicks": 361836,
- "UnchangedTicks": 0,
- "UnchangedVolume": 0,
- "UpTicks": 178823,
- "UpVolume": 18735535,
- "Epoch": 1604610000000,
- "BarStatus": "Closed"
}, - {
- "High": "224.36",
- "Low": "218.03",
- "Open": "222.26",
- "Close": "223.72",
- "TimeStamp": "2020-11-06T21:00:00Z",
- "TotalVolume": "25231895",
- "DownTicks": 133711,
- "DownVolume": 11316342,
- "OpenInterest": "0",
- "IsRealtime": false,
- "IsEndOfHistory": false,
- "TotalTicks": 264709,
- "UnchangedTicks": 0,
- "UnchangedVolume": 0,
- "UpTicks": 130998,
- "UpVolume": 13915552,
- "Epoch": 1604696400000,
- "BarStatus": "Closed"
}, - {
- "High": "228.12",
- "Low": "217.88",
- "Open": "224.44",
- "Close": "218.39",
- "TimeStamp": "2020-11-09T21:00:00Z",
- "TotalVolume": "44394950",
- "DownTicks": 235457,
- "DownVolume": 21574898,
- "OpenInterest": "0",
- "IsRealtime": false,
- "IsEndOfHistory": false,
- "TotalTicks": 465313,
- "UnchangedTicks": 0,
- "UnchangedVolume": 0,
- "UpTicks": 229856,
- "UpVolume": 22820052,
- "Epoch": 1604955600000,
- "BarStatus": "Closed"
}, - {
- "High": "216.5",
- "Low": "209.72",
- "Open": "214.5",
- "Close": "211.01",
- "TimeStamp": "2020-11-10T21:00:00Z",
- "TotalVolume": "44045120",
- "DownTicks": 255158,
- "DownVolume": 24260371,
- "OpenInterest": "0",
- "IsRealtime": false,
- "IsEndOfHistory": false,
- "TotalTicks": 504261,
- "UnchangedTicks": 0,
- "UnchangedVolume": 0,
- "UpTicks": 249103,
- "UpVolume": 19784749,
- "Epoch": 1605042000000,
- "BarStatus": "Closed"
}, - {
- "High": "218.04",
- "Low": "212.2",
- "Open": "212.39",
- "Close": "216.55",
- "TimeStamp": "2020-11-11T21:00:00Z",
- "TotalVolume": "29440788",
- "DownTicks": 136081,
- "DownVolume": 13168065,
- "OpenInterest": "0",
- "IsRealtime": false,
- "IsEndOfHistory": false,
- "TotalTicks": 270657,
- "UnchangedTicks": 0,
- "UnchangedVolume": 0,
- "UpTicks": 134576,
- "UpVolume": 16272722,
- "Epoch": 1605128400000,
- "BarStatus": "Closed"
}, - {
- "High": "219.11",
- "Low": "214.46",
- "Open": "217.21",
- "Close": "215.44",
- "TimeStamp": "2020-11-12T21:00:00Z",
- "TotalVolume": "21616115",
- "DownTicks": 122980,
- "DownVolume": 12337101,
- "OpenInterest": "0",
- "IsRealtime": false,
- "IsEndOfHistory": true,
- "TotalTicks": 245221,
- "UnchangedTicks": 0,
- "UnchangedVolume": 0,
- "UpTicks": 122241,
- "UpVolume": 9279014,
- "Epoch": 1605214800000,
- "BarStatus": "Closed"
}
]
}
Stream Bars
Streams marketdata bars for the given symbol, interval, and timeframe.
path Parameters
symbol required | string Example: MSFT The valid symbol string. |
query Parameters
interval | string Default: "1" Example: interval=1 Interval that each bar will consist of - for minute bars, the number of
minutes aggregated in a single bar. For bar units other than minute, value must be |
unit | string Default: "Daily" Example: unit=Daily Unit of time for each bar interval. Valid values are: |
barsback | string Example: barsback=5 The bars back - the max value is 57600. |
sessiontemplate | string 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. Valid values are:
|
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/stream/barcharts/MSFT' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "High": "217.32",
- "Low": "216.2",
- "Open": "217.32",
- "Close": "217",
- "TimeStamp": "2020-11-12T17:00:00Z",
- "TotalVolume": "807033",
- "DownTicks": 2091,
- "DownVolume": 396976,
- "OpenInterest": "0",
- "IsRealtime": false,
- "IsEndOfHistory": false,
- "TotalTicks": 4296,
- "UnchangedTicks": 0,
- "UnchangedVolume": 0,
- "UpTicks": 2205,
- "UpVolume": 410057,
- "Epoch": 1605200400000,
- "BarStatus": "Open"
}
Get Crypto Symbol Names
Fetches crypto Symbol Names for all available symbols, i.e., BTCUSD, ETHUSD, LTCUSD and BCHUSD. Note that while data can be obtained for these symbols, they cannot be traded.
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/symbollists/cryptopairs/symbolnames' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "SymbolNames": [
- "BTCUSD",
- "ETHUSD",
- "LTCUSD",
- "BCHUSD"
]
}
Get Symbol Details
Fetches symbol details and formatting information for one or more symbols and relevant errors, if any. Use provided formatting objects to display provided prices and quantities from other API endpoints.
Decimal prices should be displayed as decimals. For instance, for a given price of
123.2
the price should be displayed as123.20
.Fraction price display formatting should be displayed with the
PriceFormat.Fraction
in the denominator of the fraction part of the given number. For instance, given a price of534.5
and aPriceFormat.Fraction
of8
, the number should be shown as534 4/8
.For SubFractional price display formatting, the following equations can be used to derive the display format of
a'b.c
for a given price. For instance, given a price of125.92969
, aPriceFormat.Fraction
of32
and aPriceFormat.Subfraction
of4
, the number should be displayed as125'29.7
.x (Price) = 125.92969 y (PriceFormat.Fraction) = 32 z (PriceFormat.SubFraction) = 4
a = trunc(x) b = trunc(frac(x) * y) c = trunc(((frac(x) - (b/y)) * z * y) / (z/10))
path Parameters
symbols required | string Example: MSFT,BTCUSD List of valid symbols in comma separated format; for example |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/symbols/MSFT,BTCUSD' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Symbols": [
- {
- "AssetType": "STOCK",
- "Country": "United States",
- "Currency": "USD",
- "Description": "Microsoft Corp",
- "Exchange": "NASDAQ",
- "Symbol": "MSFT",
- "Root": "MSFT",
- "PriceFormat": {
- "Format": "Decimal",
- "Decimals": "2",
- "IncrementStyle": "Simple",
- "Increment": "0.01",
- "PointValue": "1"
}, - "QuantityFormat": {
- "Format": "Decimal",
- "Decimals": "0",
- "IncrementStyle": "Simple",
- "Increment": "1",
- "MinimumTradeQuantity": "1"
}
}, - {
- "AssetType": "FUTURE",
- "Country": "United States",
- "Currency": "USD",
- "Description": "Corn Continuous Contract [Mar21]",
- "Exchange": "CBOT",
- "FutureType": "Electronic",
- "Symbol": "@C",
- "Root": "C",
- "Underlying": "CH21",
- "PriceFormat": {
- "Format": "Fraction",
- "Fraction": "8",
- "IncrementStyle": "Simple",
- "Increment": "0.25",
- "PointValue": "50"
}, - "QuantityFormat": {
- "Format": "Decimal",
- "Decimals": "0",
- "IncrementStyle": "Simple",
- "Increment": "1",
- "MinimumTradeQuantity": "1"
}
}, - {
- "AssetType": "FUTURE",
- "Country": "United States",
- "Currency": "USD",
- "Description": "5 Yr U.S.Treasury Notes Continuous Contract [Mar21]",
- "Exchange": "CBOT",
- "FutureType": "Electronic",
- "Symbol": "@FV",
- "Root": "FV",
- "Underlying": "FVH21",
- "PriceFormat": {
- "Format": "SubFraction",
- "Fraction": "32",
- "SubFraction": "4",
- "IncrementStyle": "Simple",
- "Increment": "0.0078125",
- "PointValue": "1000"
}, - "QuantityFormat": {
- "Format": "Decimal",
- "Decimals": "0",
- "IncrementStyle": "Simple",
- "Increment": "1",
- "MinimumTradeQuantity": "1"
}
}
], - "Errors": [ ]
}
Get Option Expirations
Get the available option contract expiration dates for the underlying symbol.
path Parameters
underlying required | string Example: AAPL The symbol for the underlying security on which the option contracts are based. The underlying symbol must be an equity or index. |
query Parameters
strikePrice | number <double> Strike price. If provided, only expirations for that strike price will be returned. |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/options/expirations/AAPL' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 429
- 503
- 504
{- "Expirations": [
- {
- "Date": "2021-12-17T00:00:00Z",
- "Type": "Monthly"
}, - {
- "Date": "2021-12-23T00:00:00Z",
- "Type": "Weekly"
}, - {
- "Date": "2021-12-31T00:00:00Z",
- "Type": "Quarterly"
}
]
}
Get Option Risk Reward
Analyze the risk vs. reward of a potential option trade. This endpoint is not applicable for option spread types with different expirations, such as Calendar and Diagonal.
Request Body schema: application/json
SpreadPrice | number <double> The quoted price for the option spread trade. |
Array of objects (RiskRewardAnalysisInputLeg) The legs of the option spread trade. If more than one leg is specified, the expiration dates must all be the same. In addition, leg symbols must be of type stock, stock option, or index option. |
Responses
Request samples
- Payload
- Shell
- Node
- Python
- C#
{- "SpreadPrice": 0.24,
- "Legs": [
- {
- "Symbol": "AAPL 211217C150",
- "Quantity": 1,
- "TradeAction": "BUY"
}, - {
- "Symbol": "AAPL 211217C152.5",
- "Quantity": 1,
- "TradeAction": "SELL"
}, - {
- "Symbol": "AAPL 211217C155",
- "Quantity": 1,
- "TradeAction": "SELL"
}, - {
- "Symbol": "AAPL 211217C157.5",
- "Quantity": 1,
- "TradeAction": "BUY"
}
]
}
Response samples
- 200
- 400
- 401
- 403
- 429
- 503
- 504
{- "MaxGainIsInfinite": false,
- "AdjustedMaxGain": "482",
- "MaxLossIsInfinite": false,
- "AdjustedMaxLoss": "-18",
- "BreakevenPoints": [
- "150.09",
- "157.41"
]
}
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/options/spreadtypes' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 429
- 503
- 504
{- "SpreadTypes": [
- {
- "Name": "Single",
- "StrikeInterval": false,
- "ExpirationInterval": false
}, - {
- "Name": "Straddle",
- "StrikeInterval": false,
- "ExpirationInterval": false
}, - {
- "Name": "Vertical",
- "StrikeInterval": true,
- "ExpirationInterval": false
}, - {
- "Name": "Strangle",
- "StrikeInterval": true,
- "ExpirationInterval": false
}, - {
- "Name": "RatioBack1x2",
- "StrikeInterval": true,
- "ExpirationInterval": false
}, - {
- "Name": "RatioBack1x3",
- "StrikeInterval": true,
- "ExpirationInterval": false
}, - {
- "Name": "RatioBack2x3",
- "StrikeInterval": true,
- "ExpirationInterval": false
}, - {
- "Name": "Butterfly",
- "StrikeInterval": true,
- "ExpirationInterval": false
}, - {
- "Name": "IronButterfly",
- "StrikeInterval": true,
- "ExpirationInterval": false
}, - {
- "Name": "Condor",
- "StrikeInterval": true,
- "ExpirationInterval": false
}, - {
- "Name": "IronCondor",
- "StrikeInterval": true,
- "ExpirationInterval": false
}, - {
- "Name": "Covered",
- "StrikeInterval": false,
- "ExpirationInterval": false
}, - {
- "Name": "Collar",
- "StrikeInterval": true,
- "ExpirationInterval": false
}, - {
- "Name": "Combo",
- "StrikeInterval": false,
- "ExpirationInterval": false
}, - {
- "Name": "Calendar",
- "StrikeInterval": false,
- "ExpirationInterval": true
}, - {
- "Name": "Diagonal",
- "StrikeInterval": true,
- "ExpirationInterval": true
}
]
}
Get Option Strikes
Get the available strike prices for a spread type and expiration date.
path Parameters
underlying required | string Example: AAPL The symbol for the underlying security on which the option contracts are based. The underlying symbol must be an equity or index. |
query Parameters
spreadType | string Default: "Single" Example: spreadType=Butterfly The name of the spread type to get the strikes for. This value can be obtained from the Get Option Spread Types endpoint. |
strikeInterval | integer <int32> Default: 1 Specifies the desired interval between the strike prices in a spread. It must be greater than or equal to 1. A value of 1 uses consecutive strikes; a value of 2 skips one between strikes; and so on. |
expiration | string <date-time> Example: expiration=12-17-2021 Date on which the option contract expires; must be a valid expiration date. Defaults to the next contract expiration date. |
expiration2 | string <date-time> Example: expiration2=12-18-2021 Second contract expiration date required for Calendar and Diagonal spreads. |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/options/strikes/AAPL' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 429
- 503
- 504
{- "SpreadType": "Butterfly",
- "Strikes": [
- [
- "145",
- "150",
- "155"
], - [
- "150",
- "155",
- "160"
]
]
}
Stream Option Chain
Stream a chain of option spreads for a given underlying symbol, spread type, and expiration. A maximum of 10 concurrent streams is allowed.
For options calculations, the WebAPI uses the following:
- 90 days for historical volatility of the underlying
- Bjerksund and Stensland option pricing model
- Ask price for price of the option
path Parameters
underlying required | string Example: AAPL The symbol for the underlying security on which the option contracts are based. |
query Parameters
expiration | string <date-time> Example: expiration=12-17-2021 Date on which the option contract expires; must be a valid expiration date. Defaults to the next contract expiration date. |
expiration2 | string <date-time> Example: expiration2=12-17-2021 Second contract expiration date required for Calendar and Diagonal spreads. |
strikeProximity | integer <int32> Default: 5 Specifies the number of spreads to display above and below the priceCenter. |
spreadType | string Default: "Single" Example: spreadType=Butterfly Specifies the name of the spread type to use. |
riskFreeRate | number <double> The theoretical rate of return of an investment with zero risk. Defaults to the current quote for $IRX.X. The percentage rate should be specified as a decimal value. For example, to use 2% for the rate, pass in 0.02. |
priceCenter | number <double> Specifies the strike price center. Defaults to the last quoted price for the underlying security. |
strikeInterval | integer <int32> Default: 1 Specifies the desired interval between the strike prices in a spread. It must be greater than or equal to 1. A value of 1 uses consecutive strikes; a value of 2 skips one between strikes; and so on. |
enableGreeks | boolean Default: true Specifies whether or not greeks properties are returned. |
strikeRange | string Default: "All"
|
optionType | string Default: "All" Filters the spreads by a specific option type. Valid values are |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/stream/options/chains/AAPL' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 429
- 503
- 504
{- "Delta": "0.0497",
- "Theta": "-0.0049",
- "Gamma": "-0.0004",
- "Rho": "0.0005",
- "Vega": "-0.0001",
- "ImpliedVolatility": "0.3118",
- "IntrinsicValue": "0",
- "ExtrinsicValue": "0.3",
- "TheoreticalValue": "0.2816",
- "ProbabilityITM": "0.05",
- "ProbabilityOTM": "0.95",
- "ProbabilityBE": "0.0479",
- "ProbabilityITM_IV": "0.0984",
- "ProbabilityOTM_IV": "0.9016",
- "ProbabilityBE_IV": "0.0956",
- "TheoreticalValue_IV": "0.3",
- "StandardDeviation": "0.0245",
- "DailyOpenInterest": 1996,
- "Ask": "0.7",
- "Bid": "-0.1",
- "Mid": "0.3",
- "AskSize": 13,
- "BidSize": 9,
- "Close": "-0.44",
- "High": "-0.19",
- "Last": "-0.44",
- "Low": "1.05",
- "NetChange": "-1.01",
- "NetChangePct": "-1.7719",
- "Open": "0.46",
- "PreviousClose": "0.57",
- "Volume": 144,
- "Side": "Put",
- "Strikes": [
- "332.5"
], - "Legs": [
- {
- "Symbol": "MSFT 211217P332.5",
- "Ratio": 1,
- "StrikePrice": "332.5",
- "Expiration": "2021-12-17T00:00:00Z",
- "OptionType": "Put",
- "AssetType": "StockOption"
}
]
}
Stream Option Quotes
Stream price quotes and greeks for the specified option spread. A maximum of 10 concurrent streams is allowed. Leg indexes are expected to be sequential starting at zero. For example, if there are three legs, the legs in the request should contain Legs[0], Legs[1], and Legs[2]. Note that there is no required order for the Legs in the query parameters. For example, if there are 2 legs, Legs[0].Symbol, Legs[0].Ratio, Legs[1].Symbol, and Legs[1].Ratio can be in any order in the query parameters.
For options calculations, the WebAPI uses the following:
- 90 days for historical volatility of the underlying
- Bjerksund and Stensland option pricing model
- Ask price for price of the option
query Parameters
legs[0].Symbol required | string Example: legs[0].Symbol=MSFT 220916C305
|
legs[0].Ratio | number Default: 1
|
riskFreeRate | number <double> The theoretical rate of return of an investment with zero risk. Defaults to the current quote for $IRX.X. The percentage rate should be specified as a decimal value. For example, to use 2% for the rate, pass in 0.02. |
enableGreeks | boolean Default: true Specifies whether or not greeks properties are returned. |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/stream/options/quotes?legs%5B0%5D.Symbol=MSFT%20220916C305' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 429
- 503
- 504
{- "Delta": "0.0497",
- "Theta": "-0.0049",
- "Gamma": "-0.0004",
- "Rho": "0.0005",
- "Vega": "-0.0001",
- "ImpliedVolatility": "0.3118",
- "IntrinsicValue": "0",
- "ExtrinsicValue": "0.3",
- "TheoreticalValue": "0.2816",
- "ProbabilityITM": "0.05",
- "ProbabilityOTM": "0.95",
- "ProbabilityBE": "0.0479",
- "ProbabilityITM_IV": "0.0984",
- "ProbabilityOTM_IV": "0.9016",
- "ProbabilityBE_IV": "0.0956",
- "TheoreticalValue_IV": "0.3",
- "StandardDeviation": "0.0245",
- "DailyOpenInterest": 1996,
- "Ask": "0.7",
- "Bid": "-0.1",
- "Mid": "0.3",
- "AskSize": 13,
- "BidSize": 9,
- "Close": "-0.44",
- "High": "-0.19",
- "Last": "-0.44",
- "Low": "1.05",
- "NetChange": "-1.01",
- "NetChangePct": "-1.7719",
- "Open": "0.46",
- "PreviousClose": "0.57",
- "Volume": 144,
- "Side": "Put",
- "Strikes": [
- "332.5"
], - "Legs": [
- {
- "Symbol": "MSFT 211217P332.5",
- "Ratio": 1,
- "StrikePrice": "332.5",
- "Expiration": "2021-12-17T00:00:00Z",
- "OptionType": "Put",
- "AssetType": "StockOption"
}
]
}
Get Quote Snapshots
Fetches a full snapshot of the latest Quote for the given Symbols. For realtime Quote updates, users should use the Quote Stream endpoint.
path Parameters
symbols required | string Example: MSFT,BTCUSD List of valid symbols in comma separated format; for example |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/quotes/MSFT,BTCUSD' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Quotes": [
- {
- "Symbol": "MSFT",
- "Open": "213.65",
- "High": "215.77",
- "Low": "205.48",
- "PreviousClose": "214.46",
- "Last": "212.85",
- "Ask": "212.87",
- "AskSize": "300",
- "Bid": "212.85",
- "BidSize": "200",
- "NetChange": "-1.61",
- "NetChangePct": "3.5",
- "High52Week": "232.86",
- "High52WeekTimestamp": "2020-09-02T00:00:00Z",
- "Low52Week": "132.52",
- "Low52WeekTimestamp": "2020-03-23T00:00:00Z",
- "Volume": "5852511",
- "PreviousVolume": "24154112",
- "Close": "212.85",
- "DailyOpenInterest": "0",
- "TradeTime": "2020-11-18T15:19:14Z",
- "TickSizeTier": "0",
- "MarketFlags": {
- "IsDelayed": false,
- "IsHardToBorrow": false,
- "IsBats": false,
- "IsHalted": false
}, - "LastSize": "954",
- "LastVenue": "ARCX",
- "VWAP": "136.340542862433"
}
]
}
Stream Quotes
Streams Quote changes for one or more symbols.
path Parameters
symbols required | string Example: MSFT,BTCUSD List of valid symbols in comma separated format; for example |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/stream/quotes/MSFT,BTCUSD' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Symbol": "MSFT",
- "Open": "213.65",
- "PreviousClose": "214.46",
- "Last": "212.85",
- "Ask": "212.87",
- "AskSize": "300",
- "Bid": "212.85",
- "BidSize": "200",
- "NetChange": "-1.61",
- "NetChangePct": "0.035",
- "High52Week": "232.86",
- "High52WeekTimestamp": "2020-09-02T00:00:00Z",
- "Low52Week": "132.52",
- "Low52WeekTimestamp": "2020-03-23T00:00:00Z",
- "Volume": "5852511",
- "PreviousVolume": "24154112",
- "Close": "212.85",
- "DailyOpenInterest": "0",
- "TradeTime": "2020-11-18T15:19:14Z",
- "TickSizeTier": "0",
- "MarketFlags": {
- "IsDelayed": false,
- "IsHardToBorrow": false,
- "IsBats": false,
- "IsHalted": false
}
}
Stream Market Depth Quotes
Stream market depth quotes for equities, futures and stock options. A separate quote is returned for each price, side, and participant.
path Parameters
symbol required | string Example: MSFT A valid symbol for the security. |
query Parameters
maxlevels | integer <int32> Default: 20 The maximum number of market depth levels to return. Must be a positive integer. If omitted it defaults to 20. |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/stream/marketdepth/quotes/MSFT' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 429
- 503
- 504
{- "Bids": [
- {
- "TimeStamp": "2022-06-28T12:34:56Z",
- "Side": "Bid",
- "Price": "123.45",
- "Size": "100",
- "OrderCount": 5,
- "Name": "NSDQ"
}
], - "Asks": [
- {
- "TimeStamp": "2022-06-28T12:34:56Z",
- "Side": "Ask",
- "Price": "123.45",
- "Size": "100",
- "OrderCount": 5,
- "Name": "NSDQ"
}
]
}
Stream Market Depth Aggregates
Stream aggregate market depth quotes for equities, futures and stock options. A separate quote is returned for each price and side, using aggregated data from the participants.
path Parameters
symbol required | string Example: MSFT A valid symbol for the security. |
query Parameters
maxlevels | integer <int32> Default: 20 The maximum number of market depth levels to return. Must be a positive integer. If omitted it defaults to 20. |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/marketdata/stream/marketdepth/aggregates/MSFT' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 429
- 503
- 504
{- "Bids": [
- {
- "EarliestTime": "2022-06-28T12:34:56Z",
- "LatestTime": "2022-06-28T12:34:56Z",
- "Side": "Bid",
- "Price": "123.45",
- "TotalSize": "9000",
- "BiggestSize": "1500",
- "SmallestSize": "100",
- "NumParticipants": 5,
- "TotalOrderCount": 15
}
], - "Asks": [
- {
- "EarliestTime": "2022-06-28T12:34:56Z",
- "LatestTime": "2022-06-28T12:34:56Z",
- "Side": "Ask",
- "Price": "123.45",
- "TotalSize": "9000",
- "BiggestSize": "1500",
- "SmallestSize": "100",
- "NumParticipants": 5,
- "TotalOrderCount": 15
}
]
}
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/brokerage/accounts' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Accounts": [
- {
- "AccountID": "123456789",
- "Currency": "USD",
- "Status": "Active",
- "AccountType": "Cash",
- "AccountDetail": {
- "IsStockLocateEligible": false,
- "EnrolledInRegTProgram": false,
- "RequiresBuyingPowerWarning": false,
- "DayTradingQualified": true,
- "OptionApprovalLevel": 0,
- "PatternDayTrader": false
}
}, - {
- "AccountID": "123456782",
- "Currency": "USD",
- "Status": "Active",
- "AccountType": "Margin",
- "AccountDetail": {
- "IsStockLocateEligible": false,
- "EnrolledInRegTProgram": true,
- "RequiresBuyingPowerWarning": true,
- "DayTradingQualified": true,
- "OptionApprovalLevel": 1,
- "PatternDayTrader": false
}
}, - {
- "AccountID": "123456781",
- "Currency": "USD",
- "Status": "Active",
- "AccountType": "Futures"
}
]
}
Get Balances
Fetches the brokerage account Balances
for one or more given accounts. Request valid for Cash
, Margin
, Futures
, and DVP
account types.
path Parameters
accounts required | string Example: 61999124,68910124 List of valid Account IDs for the authenticated user in comma separated format; for example |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/brokerage/accounts/61999124,68910124/balances' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Balances": [
- {
- "AccountID": "123456789",
- "AccountType": "Cash",
- "CashBalance": "987654319787",
- "BuyingPower": "987654319786.82",
- "Equity": "987654321539.0976",
- "MarketValue": "1751.625",
- "TodaysProfitLoss": "4.9376",
- "UnclearedDeposit": "0",
- "BalanceDetail": {
- "CostOfPositions": "1471.98",
- "DayTrades": "0",
- "MaintenanceRate": "67096993251.19",
- "OptionBuyingPower": "987654319787",
- "OptionsMarketValue": "0",
- "OvernightBuyingPower": "987654319786.82",
- "RequiredMargin": "2371.98",
- "RealizedProfitLoss": "0",
- "UnrealizedProfitLoss": "-620.355"
}, - "Commission": "0"
}, - {
- "AccountID": "123456782",
- "AccountType": "Margin",
- "CashBalance": "39735538.661",
- "BuyingPower": "39735498.661",
- "Equity": "39893233.6211",
- "MarketValue": "157727.6092",
- "TodaysProfitLoss": "982.8001",
- "UnclearedDeposit": "0",
- "BalanceDetail": {
- "CostOfPositions": "134589.21",
- "DayTrades": "0",
- "MaintenanceRate": "29720.06",
- "OptionBuyingPower": "39735538.661",
- "OptionsMarketValue": "0",
- "OvernightBuyingPower": "39735458.661",
- "RequiredMargin": "134589.21",
- "RealizedProfitLoss": "0",
- "UnrealizedProfitLoss": "23138.3992000534"
}, - "Commission": "0"
}, - {
- "AccountID": "123456781",
- "AccountType": "Futures",
- "CashBalance": "123456784.32",
- "BuyingPower": "123455574.320001",
- "Equity": "123456184.320001",
- "MarketValue": "996750",
- "TodaysProfitLoss": "-549.999999",
- "UnclearedDeposit": "0",
- "BalanceDetail": {
- "DayTradeExcess": "123455574.320001",
- "RealizedProfitLoss": "0",
- "UnrealizedProfitLoss": "-599.999999",
- "DayTradeOpenOrderMargin": "0",
- "OpenOrderMargin": "0",
- "DayTradeMargin": "660",
- "InitialMargin": "660",
- "MaintenanceMargin": "600",
- "TradeEquity": "-549.999999",
- "SecurityOnDeposit": "0",
- "TodayRealTimeTradeEquity": "-599.999999"
}, - "CurrencyDetails": [
- {
- "Currency": "USD",
- "Commission": "0",
- "CashBalance": "123456784.32",
- "RealizedProfitLoss": "0",
- "UnrealizedProfitLoss": "-599.999999",
- "InitialMargin": "660",
- "MaintenanceMargin": "600",
- "AccountConversionRate": "1"
}
], - "Commission": "0"
}
], - "Errors": [
- {
- "AccountID": "123456789C",
- "Error": "Forbidden",
- "Message": "Request not supported for account type."
}
]
}
Get Balances BOD
Fetches the Beginning of Day Balances for the given Accounts. Request valid for Cash
, Margin
, Futures
, and DVP
account types.
path Parameters
accounts required | string Example: 61999124,68910124 List of valid Account IDs for the authenticated user in comma separated format; for example |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/brokerage/accounts/61999124,68910124/bodbalances' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "BODBalances": [
- {
- "AccountID": "123456789",
- "AccountType": "Cash",
- "BalanceDetail": {
- "AccountBalance": "987654321258.98",
- "CashAvailableToWithdraw": "987654321258.98",
- "DayTradingMarginableBuyingPower": "987654321258.98",
- "DayTrades": "0",
- "Equity": "987654321258.98",
- "NetCash": "987654321258.98",
- "OptionBuyingPower": "987654321258.98",
- "OptionValue": "0",
- "OvernightBuyingPower": "987654321258.98"
}
}, - {
- "AccountID": "123456782",
- "AccountType": "Margin",
- "BalanceDetail": {
- "AccountBalance": "40000000",
- "CashAvailableToWithdraw": "40000000",
- "DayTradingMarginableBuyingPower": "40000000",
- "DayTrades": "0",
- "Equity": "40000000",
- "NetCash": "40000000",
- "OptionBuyingPower": "40000000",
- "OptionValue": "0",
- "OvernightBuyingPower": "80000000"
}
}, - {
- "AccountID": "123456781",
- "AccountType": "Futures",
- "BalanceDetail": {
- "Equity": "123456784.32",
- "CashAvailableToWithdraw": "123456784.32",
- "NetCash": "123456784.32",
- "OpenTradeEquity": "0",
- "SecurityOnDeposit": "0"
}, - "CurrencyDetails": [
- {
- "Currency": "USD",
- "CashBalance": "123456784.32",
- "AccountOpenTradeEquity": "0",
- "AccountSecurities": "0",
- "OpenTradeEquity": "0",
- "Securities": "0"
}
]
}
], - "Errors": [
- {
- "AccountID": "123456789C",
- "Error": "Forbidden",
- "Message": "Request not supported for account type."
}
]
}
Get Historical Orders
Fetches Historical Orders for the given Accounts except open orders, sorted in descending order of time closed. Request valid for all account types.
path Parameters
accounts required | string Example: 61999124,68910124 List of valid Account IDs for the authenticated user in comma separated format; for example |
query Parameters
since required | string Example: since=2006-01-13 Historical orders since date. For example |
pageSize | integer [ 1 .. 600 ] Default: 600 Example: pageSize=600 The number of requests returned per page when paginating responses. If not provided, results will not be paginated and a maximum of 600 orders is returned. |
nextToken | string Example: nextToken=eyJ0aW1lc3RhbXAiOjE2NT...NTMwMDB9 An encrypted token with a lifetime of 1 hour for use with paginated order responses. This is returned with paginated results, and used in only the subsequent request which will return a new nextToken until there are fewer returned orders than the requested pageSize. If the number of returned orders equals the pageSize, and there are no additional orders, the nextToken will not be generated. |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/brokerage/accounts/61999124,68910124/historicalorders?since=2006-01-13' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Orders": [
- {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-05-25T00:00:00Z",
- "Legs": [
- {
- "AssetType": "STOCK",
- "BuyOrSell": "Buy",
- "ExecQuantity": "0",
- "ExecutionPrice": "112.28",
- "ExpirationDate": "2021-05-25T00:00:00Z",
- "OpenOrClose": "Open",
- "OptionType": "CALL",
- "QuantityOrdered": "10",
- "QuantityRemaining": "10",
- "StrikePrice": "350",
- "Symbol": "MSFT",
- "Underlying": "MSFT"
}
], - "MarketActivationRules": [
- {
- "RuleType": "Price",
- "Symbol": "EDZ22",
- "Predicate": "gt",
- "TriggerKey": "STTN",
- "Price": "10000.01"
}
], - "OrderID": "286234131",
- "OpenedDateTime": "2021-02-24T15:47:45Z",
- "OrderType": "Market",
- "PriceUsedForBuyingPower": "230.46",
- "Routing": "Intelligent",
- "Status": "OPN",
- "StatusDescription": "Sent",
- "AdvancedOptions": "CND=EDZ22>10000.01(STTN);TIM=23:59:59;",
- "TimeActivationRules": [
- {
- "TimeUtc": "0001-01-01T23:59:59Z"
}
], - "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ClosedDateTime": "2020-11-16T16:53:37Z",
- "Currency": "USD",
- "Duration": "GTC",
- "FilledPrice": "216.68",
- "GoodTillDate": "2021-02-14T00:00:00Z",
- "Legs": [
- {
- "OpenOrClose": "Open",
- "QuantityOrdered": "10",
- "ExecQuantity": "10",
- "QuantityRemaining": "0",
- "BuyOrSell": "Buy",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "123456789",
- "OpenedDateTime": "2020-11-16T16:53:37Z",
- "OrderType": "Market",
- "PriceUsedForBuyingPower": "216.66",
- "Routing": "Intelligent",
- "Status": "FLL",
- "StatusDescription": "Filled",
- "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179864"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "LimitPrice": "230",
- "OrderID": "286179863",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "Limit",
- "PriceUsedForBuyingPower": "230",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "AdvancedOptions": "OCA=2706452145;",
- "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179863"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "286179864",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "StopMarket",
- "PriceUsedForBuyingPower": "215.06",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "StopPrice": "130",
- "AdvancedOptions": "STPTRG=STT;OCA=2706452145;",
- "UnbundledRouteFee": "0"
}
], - "Errors": [ ],
- "NextToken": "eyJ0aW1lc3RhbXAiOjE2NTY1NjI2MDQwMDEs>LTM3QzAtNEIxOS04OTU4LUExQ0YwQjYwRDM3NSIsImV4cGlyYXRpb25UaW1lc3RhbXAiOjE2NTY2OTM3NTMwMDB9"
}
Get Historical Orders By Order ID
Fetches Historical Orders for the given Accounts except open orders, filtered by given Order IDs prior to current date, sorted in descending order of time closed. Request valid for all account types.
path Parameters
accounts required | string Example: 61999124,68910124 List of valid Account IDs for the authenticated user in comma separated format; for example |
orderIds required | string Example: 123456789,286179863 List of valid Order IDs for the authenticated user for given accounts in comma separated format; for example |
query Parameters
since required | string Example: since=2006-01-13 Historical orders since date. For example |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/brokerage/accounts/61999124,68910124/historicalorders/123456789,286179863?since=2006-01-13' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Orders": [
- {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-05-25T00:00:00Z",
- "Legs": [
- {
- "AssetType": "STOCK",
- "BuyOrSell": "Buy",
- "ExecQuantity": "0",
- "ExecutionPrice": "112.28",
- "ExpirationDate": "2021-05-25T00:00:00Z",
- "OpenOrClose": "Open",
- "OptionType": "CALL",
- "QuantityOrdered": "10",
- "QuantityRemaining": "10",
- "StrikePrice": "350",
- "Symbol": "MSFT",
- "Underlying": "MSFT"
}
], - "MarketActivationRules": [
- {
- "RuleType": "Price",
- "Symbol": "EDZ22",
- "Predicate": "gt",
- "TriggerKey": "STTN",
- "Price": "10000.01"
}
], - "OrderID": "286234131",
- "OpenedDateTime": "2021-02-24T15:47:45Z",
- "OrderType": "Market",
- "PriceUsedForBuyingPower": "230.46",
- "Routing": "Intelligent",
- "Status": "OPN",
- "StatusDescription": "Sent",
- "AdvancedOptions": "CND=EDZ22>10000.01(STTN);TIM=23:59:59;",
- "TimeActivationRules": [
- {
- "TimeUtc": "0001-01-01T23:59:59Z"
}
], - "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ClosedDateTime": "2020-11-16T16:53:37Z",
- "Currency": "USD",
- "Duration": "GTC",
- "FilledPrice": "216.68",
- "GoodTillDate": "2021-02-14T00:00:00Z",
- "Legs": [
- {
- "OpenOrClose": "Open",
- "QuantityOrdered": "10",
- "ExecQuantity": "10",
- "QuantityRemaining": "0",
- "BuyOrSell": "Buy",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "123456789",
- "OpenedDateTime": "2020-11-16T16:53:37Z",
- "OrderType": "Market",
- "PriceUsedForBuyingPower": "216.66",
- "Routing": "Intelligent",
- "Status": "FLL",
- "StatusDescription": "Filled",
- "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179864"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "LimitPrice": "230",
- "OrderID": "286179863",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "Limit",
- "PriceUsedForBuyingPower": "230",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "AdvancedOptions": "OCA=2706452145;",
- "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179863"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "286179864",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "StopMarket",
- "PriceUsedForBuyingPower": "215.06",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "StopPrice": "130",
- "AdvancedOptions": "STPTRG=STT;OCA=2706452145;",
- "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179863"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "286179864",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "StopMarket",
- "PriceUsedForBuyingPower": "215.06",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "StopPrice": "215.06",
- "AdvancedOptions": "STPTRG=STT;TRL=5%;",
- "TrailingStop": {
- "Percent": "5.0"
}, - "UnbundledRouteFee": "0"
}
], - "Errors": [ ]
}
Get Orders
Fetches today's orders and open orders for the given Accounts, sorted in descending order of time placed for open and time executed for closed. Request valid for all account types.
path Parameters
accounts required | string Example: 61999124,68910124 List of valid Account IDs for the authenticated user in comma separated format; for example |
query Parameters
pageSize | integer [ 1 .. 600 ] Default: 600 Example: pageSize=600 The number of requests returned per page when paginating responses. If not provided, results will not be paginated and a maximum of 600 orders is returned. |
nextToken | string Example: nextToken=eyJ0aW1lc3RhbXAiOjE2NT...NTMwMDB9 An encrypted token with a lifetime of 1 hour for use with paginated order responses. This is returned with paginated results, and used in only the subsequent request which will return a new nextToken until there are fewer returned orders than the requested pageSize. If the number of returned orders equals the pageSize, and there are no additional orders, the nextToken will not be generated. |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/brokerage/accounts/61999124,68910124/orders' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Orders": [
- {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-05-25T00:00:00Z",
- "Legs": [
- {
- "AssetType": "STOCK",
- "BuyOrSell": "Buy",
- "ExecQuantity": "0",
- "ExecutionPrice": "112.28",
- "ExpirationDate": "2021-05-25T00:00:00Z",
- "OpenOrClose": "Open",
- "OptionType": "CALL",
- "QuantityOrdered": "10",
- "QuantityRemaining": "10",
- "StrikePrice": "350",
- "Symbol": "MSFT",
- "Underlying": "MSFT"
}
], - "MarketActivationRules": [
- {
- "RuleType": "Price",
- "Symbol": "EDZ22",
- "Predicate": "gt",
- "TriggerKey": "STTN",
- "Price": "10000.01"
}
], - "OrderID": "286234131",
- "OpenedDateTime": "2021-02-24T15:47:45Z",
- "OrderType": "Market",
- "PriceUsedForBuyingPower": "230.46",
- "Routing": "Intelligent",
- "Status": "OPN",
- "StatusDescription": "Sent",
- "AdvancedOptions": "CND=EDZ22>10000.01(STTN);TIM=23:59:59;",
- "TimeActivationRules": [
- {
- "TimeUtc": "0001-01-01T23:59:59Z"
}
], - "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ClosedDateTime": "2020-11-16T16:53:37Z",
- "Currency": "USD",
- "Duration": "GTC",
- "FilledPrice": "216.68",
- "GoodTillDate": "2021-02-14T00:00:00Z",
- "Legs": [
- {
- "OpenOrClose": "Open",
- "QuantityOrdered": "10",
- "ExecQuantity": "10",
- "QuantityRemaining": "0",
- "BuyOrSell": "Buy",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "123456789",
- "OpenedDateTime": "2020-11-16T16:53:37Z",
- "OrderType": "Market",
- "PriceUsedForBuyingPower": "216.66",
- "Routing": "Intelligent",
- "Status": "FLL",
- "StatusDescription": "Filled",
- "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179864"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "LimitPrice": "230",
- "OrderID": "286179863",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "Limit",
- "PriceUsedForBuyingPower": "230",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "AdvancedOptions": "OCA=2706452145;",
- "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179863"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "286179864",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "StopMarket",
- "PriceUsedForBuyingPower": "215.06",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "StopPrice": "130",
- "AdvancedOptions": "STPTRG=STT;OCA=2706452145;",
- "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179863"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "286179864",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "StopMarket",
- "PriceUsedForBuyingPower": "215.06",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "StopPrice": "215.06",
- "AdvancedOptions": "STPTRG=STT;TRL=5%;",
- "TrailingStop": {
- "Percent": "5.0"
}, - "UnbundledRouteFee": "0"
}
], - "Errors": [ ],
- "NextToken": "eyJ0aW1lc3RhbXAiOjE2NTY1NjI2MDQwMDEs>LTM3QzAtNEIxOS04OTU4LUExQ0YwQjYwRDM3NSIsImV4cGlyYXRpb25UaW1lc3RhbXAiOjE2NTY2OTM3NTMwMDB9"
}
Get Orders By Order ID
Fetches today's orders and open orders for the given Accounts, filtered by given Order IDs, sorted in descending order of time placed for open and time executed for closed. Request valid for all account types.
path Parameters
accounts required | string Example: 61999124,68910124 List of valid Account IDs for the authenticated user in comma separated format; for example |
orderIds required | string Example: 123456789,286179863 List of valid Order IDs for the authenticated user for given accounts in comma separated format; for example |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/brokerage/accounts/61999124,68910124/orders/123456789,286179863' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Orders": [
- {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-05-25T00:00:00Z",
- "Legs": [
- {
- "AssetType": "STOCK",
- "BuyOrSell": "Buy",
- "ExecQuantity": "0",
- "ExecutionPrice": "112.28",
- "ExpirationDate": "2021-05-25T00:00:00Z",
- "OpenOrClose": "Open",
- "OptionType": "CALL",
- "QuantityOrdered": "10",
- "QuantityRemaining": "10",
- "StrikePrice": "350",
- "Symbol": "MSFT",
- "Underlying": "MSFT"
}
], - "MarketActivationRules": [
- {
- "RuleType": "Price",
- "Symbol": "EDZ22",
- "Predicate": "gt",
- "TriggerKey": "STTN",
- "Price": "10000.01"
}
], - "OrderID": "286234131",
- "OpenedDateTime": "2021-02-24T15:47:45Z",
- "OrderType": "Market",
- "PriceUsedForBuyingPower": "230.46",
- "Routing": "Intelligent",
- "Status": "OPN",
- "StatusDescription": "Sent",
- "AdvancedOptions": "CND=EDZ22>10000.01(STTN);TIM=23:59:59;",
- "TimeActivationRules": [
- {
- "TimeUtc": "0001-01-01T23:59:59Z"
}
], - "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ClosedDateTime": "2020-11-16T16:53:37Z",
- "Currency": "USD",
- "Duration": "GTC",
- "FilledPrice": "216.68",
- "GoodTillDate": "2021-02-14T00:00:00Z",
- "Legs": [
- {
- "OpenOrClose": "Open",
- "QuantityOrdered": "10",
- "ExecQuantity": "10",
- "QuantityRemaining": "0",
- "BuyOrSell": "Buy",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "123456789",
- "OpenedDateTime": "2020-11-16T16:53:37Z",
- "OrderType": "Market",
- "PriceUsedForBuyingPower": "216.66",
- "Routing": "Intelligent",
- "Status": "FLL",
- "StatusDescription": "Filled",
- "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179864"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "LimitPrice": "230",
- "OrderID": "286179863",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "Limit",
- "PriceUsedForBuyingPower": "230",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "AdvancedOptions": "OCA=2706452145;",
- "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179863"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "286179864",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "StopMarket",
- "PriceUsedForBuyingPower": "215.06",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "StopPrice": "130",
- "AdvancedOptions": "STPTRG=STT;OCA=2706452145;",
- "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179863"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "286179864",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "StopMarket",
- "PriceUsedForBuyingPower": "215.06",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "StopPrice": "215.06",
- "AdvancedOptions": "STPTRG=STT;TRL=5%;",
- "TrailingStop": {
- "Percent": "5.0"
}, - "UnbundledRouteFee": "0"
}
], - "Errors": [ ]
}
Get Positions
Fetches positions for the given Accounts. Request valid for Cash
, Margin
, Futures
, and DVP
account types.
path Parameters
accounts required | string Example: 61999124,68910124 List of valid Account IDs for the authenticated user in comma separated format; for example |
query Parameters
symbol | string Example: symbol=MSFT,MSFT *,AAPL List of valid symbols in comma separated format; for example Examples of the wildcard being used:
|
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/brokerage/accounts/61999124,68910124/positions' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Positions": [
- {
- "AccountID": "123456782",
- "AveragePrice": "216.68",
- "AssetType": "STOCK",
- "Last": "216.63",
- "Bid": "216.62",
- "Ask": "216.64",
- "ConversionRate": "1",
- "DayTradeRequirement": "0",
- "InitialRequirement": "0",
- "MaintenanceMargin": "0",
- "PositionID": "64630792",
- "LongShort": "Long",
- "Quantity": "10",
- "Symbol": "MSFT",
- "Timestamp": "2020-11-16T16:53:37Z",
- "TodaysProfitLoss": "-0.5",
- "TotalCost": "2166.8",
- "MarketValue": "2166.3",
- "MarkToMarketPrice": "216.68",
- "UnrealizedProfitLoss": "-0.5",
- "UnrealizedProfitLossPercent": "-0.023",
- "UnrealizedProfitLossQty": "-0.05"
}
], - "Errors": [
- {
- "AccountID": "123456782C",
- "Error": "Forbidden",
- "Message": "Request not supported for account type."
}
]
}
Stream Orders
Stream orders for the given accounts. Request valid for Cash
, Margin
, Futures
, and DVP
account types.
path Parameters
accounts required | string Example: 61999124,68910124 List of valid Account IDs for the authenticated user in comma separated format; for example |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/brokerage/stream/accounts/61999124,68910124/orders' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
[- {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-05-25T00:00:00Z",
- "Legs": [
- {
- "AssetType": "STOCK",
- "BuyOrSell": "Buy",
- "ExecQuantity": "0",
- "ExecutionPrice": "112.28",
- "ExpirationDate": "2021-05-25T00:00:00Z",
- "OpenOrClose": "Open",
- "OptionType": "CALL",
- "QuantityOrdered": "10",
- "QuantityRemaining": "10",
- "StrikePrice": "350",
- "Symbol": "MSFT",
- "Underlying": "MSFT"
}
], - "MarketActivationRules": [
- {
- "RuleType": "Price",
- "Symbol": "EDZ22",
- "Predicate": "gt",
- "TriggerKey": "STTN",
- "Price": "10000.01"
}
], - "OrderID": "286234131",
- "OpenedDateTime": "2021-02-24T15:47:45Z",
- "OrderType": "Market",
- "PriceUsedForBuyingPower": "230.46",
- "Routing": "Intelligent",
- "Status": "OPN",
- "StatusDescription": "Sent",
- "AdvancedOptions": "CND=EDZ22>10000.01(STTN);TIM=23:59:59;",
- "TimeActivationRules": [
- {
- "TimeUtc": "0001-01-01T23:59:59Z"
}
], - "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179863"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "286179864",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "StopMarket",
- "PriceUsedForBuyingPower": "215.06",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "AdvancedOptions": "STPTRG=STT;TRL=5%;",
- "TrailingStop": {
- "Percent": "5.0"
}, - "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179863"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "286179864",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "StopMarket",
- "PriceUsedForBuyingPower": "215.06",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "StopPrice": "130",
- "AdvancedOptions": "STPTRG=STT;OCA=2706452145;",
- "UnbundledRouteFee": "0"
}
]
Stream Orders by Order Id
Stream orders for the given accounts and orders. Request valid for Cash
, Margin
, Futures
, and DVP
account types.
path Parameters
accounts required | string Example: 61999124,68910124 List of valid Account IDs for the authenticated user in comma separated format; for example |
ordersIds required | string Example: 812767578,812941051 List of valid Order IDs for the account IDs in comma separated format; for example |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/brokerage/stream/accounts/61999124,68910124/orders/812767578,812941051' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
[- {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-05-25T00:00:00Z",
- "Legs": [
- {
- "AssetType": "STOCK",
- "BuyOrSell": "Buy",
- "ExecQuantity": "0",
- "ExecutionPrice": "112.28",
- "ExpirationDate": "2021-05-25T00:00:00Z",
- "OpenOrClose": "Open",
- "OptionType": "CALL",
- "QuantityOrdered": "10",
- "QuantityRemaining": "10",
- "StrikePrice": "350",
- "Symbol": "MSFT",
- "Underlying": "MSFT"
}
], - "MarketActivationRules": [
- {
- "RuleType": "Price",
- "Symbol": "EDZ22",
- "Predicate": "gt",
- "TriggerKey": "STTN",
- "Price": "10000.01"
}
], - "OrderID": "286234131",
- "OpenedDateTime": "2021-02-24T15:47:45Z",
- "OrderType": "Market",
- "PriceUsedForBuyingPower": "230.46",
- "Routing": "Intelligent",
- "Status": "OPN",
- "StatusDescription": "Sent",
- "AdvancedOptions": "CND=EDZ22>10000.01(STTN);TIM=23:59:59;",
- "TimeActivationRules": [
- {
- "TimeUtc": "0001-01-01T23:59:59Z"
}
], - "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179863"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "286179864",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "StopMarket",
- "PriceUsedForBuyingPower": "215.06",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "AdvancedOptions": "STPTRG=STT;TRL=5%;",
- "TrailingStop": {
- "Percent": "5.0"
}, - "UnbundledRouteFee": "0"
}, - {
- "AccountID": "123456782",
- "CommissionFee": "0",
- "ConditionalOrders": [
- {
- "Relationship": "OCO",
- "OrderID": "286179863"
}
], - "Currency": "USD",
- "Duration": "GTC",
- "GoodTillDate": "2021-02-15T00:00:00Z",
- "GroupName": "OCO 2706452145",
- "Legs": [
- {
- "OpenOrClose": "Close",
- "QuantityOrdered": "10",
- "ExecQuantity": "0",
- "QuantityRemaining": "10",
- "BuyOrSell": "Sell",
- "Symbol": "MSFT",
- "AssetType": "STOCK"
}
], - "OrderID": "286179864",
- "OpenedDateTime": "2020-11-17T16:34:37Z",
- "OrderType": "StopMarket",
- "PriceUsedForBuyingPower": "215.06",
- "Routing": "Intelligent",
- "Status": "ACK",
- "StatusDescription": "Received",
- "StopPrice": "130",
- "AdvancedOptions": "STPTRG=STT;OCA=2706452145;",
- "UnbundledRouteFee": "0"
}
]
Stream Positions
Stream positions for the given accounts. Request valid for Cash
, Margin
, Futures
, and DVP
account types.
path Parameters
accounts required | string Example: 61999124,68910124 List of valid Account IDs for the authenticated user in comma separated format; for example |
query Parameters
changes | boolean Default: false Example: changes=true A boolean value that specifies whether or not position updates are streamed as changes. When a stream is first opened with |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/brokerage/stream/accounts/61999124,68910124/positions' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "AccountID": "123456782",
- "AveragePrice": "216.68",
- "AssetType": "STOCK",
- "Last": "216.63",
- "Bid": "216.62",
- "Ask": "216.64",
- "ConversionRate": "1",
- "DayTradeRequirement": "0",
- "InitialRequirement": "0",
- "MaintenanceMargin": "0",
- "PositionID": "64630792",
- "LongShort": "Long",
- "Quantity": "10",
- "Symbol": "MSFT",
- "Timestamp": "2020-11-16T16:53:37Z",
- "TodaysProfitLoss": "-0.5",
- "TotalCost": "2166.8",
- "MarketValue": "2166.3",
- "MarkToMarketPrice": "216.68",
- "UnrealizedProfitLoss": "-0.5",
- "UnrealizedProfitLossPercent": "-0.023",
- "UnrealizedProfitLossQty": "-0.05"
}
Confirm Order
Returns estimated cost and commission information for an order without the order actually being placed. Request valid for Market
, Limit
, Stop Market
, Stop Limit
, Options
, and
Order Sends Order (OSO)
order types.
The fields that are returned in the response depend on the order type. The following shows the different fields that will be returned.
Base Confirmation (All confirmations will have these fields)
- Route
- Duration
- Account
- SummaryMessage
Equity Confirmation (Base Confirmation fields + the following)
- EstimatedPrice
- EstimatedPriceDisplay
- EstimatedCost
- EstimatedCostDisplay
- EstimatedCommission
- EstimatedCommissionDisplay
- DebitCreditEstimatedCost
- DebitCreditEstimatedCostDisplay
- OrderConfirmId
Futures Confirmation (Base Confirmation fields + the following)
- ProductCurrency
- AccountCurrency
- EstimatedCost
- EstimatedPrice
- EstimatedPriceDisplay
- InitialMarginDisplay
- EstimatedCommission
- EstimatedCommissionDisplay
- OrderConfirmId
Request Body schema: application/json
Order Confirmation request.
AccountID required | string (AccountID) TradeStation Account ID. |
object (AdvancedOptions) | |
BuyingPowerWarning | string For internal use only. For TradeStation Margin accounts enrolled in the Reg-T program, clients should send
confirmation that the customer has been shown appropriate buying power warnings in advance of placing an order
that could potentially violate the account's buying power. Valid values are: |
Array of objects (OrderRequestLegs) | |
LimitPrice | string The limit price for this order. |
Array of objects (OrderRequestOSO) | |
OrderConfirmID | string [ 1 .. 22 ] characters A unique identifier regarding an order used to prevent duplicates. Must be unique per API key, per order, per user. |
OrderType required | string (OrderType) Enum: "Limit" "StopMarket" "Market" "StopLimit" The order type of the order. |
Quantity required | string The quantity of the order. |
Route | string The route of the order. For Stocks and Options, Route value will default to |
StopPrice | string The stop price for this order. If a TrailingStop amount or percent is passed in with the request (in the AdvancedOptions), and a StopPrice value is also passed in, the StopPrice value is ignored. |
Symbol required | string The symbol used for this order. |
required | object (TimeInForceRequest) TimeInForce defines the duration and expiration timestamp. |
TradeAction required | string (TradeAction) TradeAction represents the different trade actions that can be sent to or received from WebAPI. Conveys the intent of the trade:
|
Responses
Request samples
- Payload
- Shell
- Node
- Python
- C#
{- "AccountID": "123456782",
- "Symbol": "MSFT",
- "Quantity": "10",
- "OrderType": "Market",
- "TradeAction": "BUY",
- "TimeInForce": {
- "Duration": "DAY"
}, - "Route": "Intelligent"
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Confirmations": [
- {
- "OrderAssetCategory": "EQUITY",
- "Currency": "USD",
- "DisplayName": "123456782",
- "Route": "Intelligent",
- "TimeInForce": {
- "Duration": "GTC"
}, - "AccountID": "123456782",
- "OrderConfirmID": "7CMygnFJXk+ihrJJfOPmVQ",
- "EstimatedPrice": "216.32",
- "EstimatedCost": "2163.2",
- "DebitCreditEstimatedCost": "2163.2",
- "EstimatedCommission": "0",
- "SummaryMessage": "Buy 10 MSFT @ Market"
}
]
}
Confirm Group Order
Creates an Order Confirmation for a group order. Request valid for all account types. Request valid for Order Cancels Order (OCO) and Bracket (BRK) order types as well as grouped orders of other types (NORMAL).
Order Cancels Order (OCO)
An OCO order is a group of orders whereby if one of the orders is filled or partially-filled, then all of the other orders in the group are cancelled.
Bracket OCO Orders
A bracket order is a special instance of an OCO (Order Cancel Order). Bracket orders are used to exit an existing position. They are designed to limit loss and lock in profit by “bracketing” an order with a simultaneous stop and limit order.
Bracket orders are limited so that the orders are all for the same symbol and are on the same side of the market (either all to sell or all to cover), and they are restricted to closing transactions.
The reason that they follow these rules is because the orders need to be able to auto decrement when a partial fill occurs with one of the orders. For example, if the customer has a sell limit order for 1000 shares and a sell stop order for 1000 shares, and the limit order is partially filled for 500 shares, then the customer would want the stop to remain open, but it should automatically decrement the order to 500 shares to match the remaining open position.
Note
When a group order is submitted, the order execution system treats each sibling order as an individual order. Thus, the system does not validate that each order has the same Quantity, and currently it is not able to update a bracket order as one transaction, instead you must update each order within a bracket.
Request Body schema: application/json
Order request
required | Array of objects (OrderRequest) |
Type required | string The group order type. Valid values are: |
Responses
Request samples
- Payload
- Shell
- Node
- Python
- C#
{- "Type": "OCO",
- "Orders": [
- {
- "AccountID": "123456782",
- "StopPrice": "337",
- "OrderType": "StopMarket",
- "Quantity": "10",
- "Route": "Intelligent",
- "Symbol": "MSFT",
- "TimeInForce": {
- "Duration": "GTC"
}, - "TradeAction": "Buy"
}, - {
- "AccountID": "123456782",
- "StopPrice": "333",
- "OrderType": "StopMarket",
- "Quantity": "10",
- "Route": "Intelligent",
- "Symbol": "MSFT",
- "TimeInForce": {
- "Duration": "GTC"
}, - "TradeAction": "SellShort"
}
]
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
[- {
- "Confirmations": [
- {
- "AccountCurrency": "string",
- "AccountID": "string",
- "AddLiquidity": true,
- "AllOrNone": true,
- "BaseCurrency": "string",
- "BookOnly": true,
- "CounterCurrency": "string",
- "Currency": "string",
- "DebitCreditEstimatedCost": "string",
- "DiscretionaryPrice": "string",
- "EstimatedCommission": "string",
- "EstimatedCost": "string",
- "EstimatedPrice": "string",
- "InitialMarginDisplay": "string",
- "Legs": [
- {
- "ExpirationDate": { },
- "OptionType": "string",
- "Quantity": "string",
- "StrikePrice": "string",
- "Symbol": "string",
- "TradeAction": "string"
}
], - "LimitPrice": "string",
- "NonDisplay": true,
- "OrderAssetCategory": "EQUITY",
- "OrderConfirmID": "string",
- "PegValue": "string",
- "ProductCurrency": "string",
- "Route": "string",
- "ShowOnlyQuantity": 0,
- "Spread": "string",
- "StopPrice": "string",
- "SummaryMessage": "string",
- "TimeInForce": {
- "Duration": "string",
- "Expiration": { }
}, - "TrailingStop": {
- "Amount": "string",
- "Percent": "string"
}, - "Underlying": "string"
}
]
}
]
Place Group Order
Submits a group order. Request valid for all account types. Request valid for Order Cancels Order (OCO) and Bracket (BRK) order types as well as grouped orders of other types (NORMAL).
Order Cancels Order (OCO)
An OCO order is a group of orders whereby if one of the orders is filled or partially-filled, then all of the other orders in the group are cancelled.
Bracket OCO Orders
A bracket order is a special instance of an OCO (Order Cancel Order). Bracket orders are used to exit an existing position. They are designed to limit loss and lock in profit by “bracketing” an order with a simultaneous stop and limit order.
Bracket orders are limited so that the orders are all for the same symbol and are on the same side of the market (either all to sell or all to cover), and they are restricted to closing transactions.
The reason that they follow these rules is because the orders need to be able to auto decrement when a partial fill occurs with one of the orders. For example, if the customer has a sell limit order for 1000 shares and a sell stop order for 1000 shares, and the limit order is partially filled for 500 shares, then the customer would want the stop to remain open, but it should automatically decrement the order to 500 shares to match the remaining open position.
Note
When a group order is submitted, the order execution system treats each sibling order as an individual order. Thus, the system does not validate that each order has the same Quantity, and currently it is not able to update a bracket order as one transaction, instead you must update each order within a bracket.
Request Body schema: application/json
Order request to place.
required | Array of objects (OrderRequest) |
Type required | string The group order type. Valid values are: |
Responses
Request samples
- Payload
- Shell
- Node
- Python
- C#
{- "Type": "OCO",
- "Orders": [
- {
- "AccountID": "123456782",
- "StopPrice": "337",
- "OrderType": "StopMarket",
- "Quantity": "10",
- "Route": "Intelligent",
- "Symbol": "MSFT",
- "TimeInForce": {
- "Duration": "GTC"
}, - "TradeAction": "Buy"
}, - {
- "AccountID": "123456782",
- "StopPrice": "333",
- "OrderType": "StopMarket",
- "Quantity": "10",
- "Route": "Intelligent",
- "Symbol": "MSFT",
- "TimeInForce": {
- "Duration": "GTC"
}, - "TradeAction": "SellShort"
}
]
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Orders": [
- {
- "Message": "Sent order: Sell 10 MSFT @ 230.00 Limit",
- "OrderID": "123456889"
}, - {
- "Message": "Sent order: Sell 10 MSFT @ 130.00 Stop Market",
- "OrderID": "123456989"
}
], - "Errors": [
- {
- "Error": "FAILED",
- "Message": "Order failed. Reason: Type = LMT has invalid Price greater than absolute maximum",
- "OrderID": "1234567"
}
]
}
Place Order
Creates a new brokerage order. Request valid for all account types. Request valid for Market, Limit, Stop Market, Stop Limit, Options and Order Sends Order (OSO) order types.
Request Body schema: application/json
Order to place.
AccountID required | string (AccountID) TradeStation Account ID. |
object (AdvancedOptions) | |
BuyingPowerWarning | string For internal use only. For TradeStation Margin accounts enrolled in the Reg-T program, clients should send
confirmation that the customer has been shown appropriate buying power warnings in advance of placing an order
that could potentially violate the account's buying power. Valid values are: |
Array of objects (OrderRequestLegs) | |
LimitPrice | string The limit price for this order. |
Array of objects (OrderRequestOSO) | |
OrderConfirmID | string [ 1 .. 22 ] characters A unique identifier regarding an order used to prevent duplicates. Must be unique per API key, per order, per user. |
OrderType required | string (OrderType) Enum: "Limit" "StopMarket" "Market" "StopLimit" The order type of the order. |
Quantity required | string The quantity of the order. |
Route | string The route of the order. For Stocks and Options, Route value will default to |
StopPrice | string The stop price for this order. If a TrailingStop amount or percent is passed in with the request (in the AdvancedOptions), and a StopPrice value is also passed in, the StopPrice value is ignored. |
Symbol required | string The symbol used for this order. |
required | object (TimeInForceRequest) TimeInForce defines the duration and expiration timestamp. |
TradeAction required | string (TradeAction) TradeAction represents the different trade actions that can be sent to or received from WebAPI. Conveys the intent of the trade:
|
Responses
Request samples
- Payload
- Shell
- Node
- Python
- C#
{- "AccountID": "123456782",
- "Symbol": "MSFT",
- "Quantity": "10",
- "OrderType": "Market",
- "TradeAction": "BUY",
- "TimeInForce": {
- "Duration": "DAY"
}, - "Route": "Intelligent"
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Orders": [
- {
- "Message": "Sent order: Sell 1 MSFT @ Market",
- "OrderID": "286179829"
}, - {
- "Message": "Sent order: Sell 1 MSFT @ 232.86 Stop Market",
- "OrderID": "286179830"
}, - {
- "Message": "Sent order: Buy 1 MSFT @ Market",
- "OrderID": "286179831"
}
], - "Errors": [
- {
- "Error": "FAILED",
- "Message": "Order failed. Reason: Type = LMT has invalid Price greater than absolute maximum",
- "OrderID": "1234567"
}
]
}
Replace Order
Replaces an active order with a modified version of that order. You cannot update an order that has been filled.
Request valid for Cash
, Margin
, Futures
, and DVP
account types.
path Parameters
orderID required | string Example: 123456789 OrderID for order to replace. Equity, option or future orderIDs should not include dashes (E.g. |
Request Body schema: application/json
Order to replace.
LimitPrice | string The limit price for this order. |
StopPrice | string The stop price for this order. If a TrailingStop amount or percent is passed in with the request (in the AdvancedOptions), and a StopPrice value is also passed in, the StopPrice value is ignored. |
OrderType | string The order type of this order. Order type can only be updated to |
Quantity | string The quantity of this order. |
object (AdvancedOptionsReplace) |
Responses
Request samples
- Payload
- Shell
- Node
- Python
- C#
{- "Quantity": "10",
- "LimitPrice": "132.52"
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Message": "Cancel/Replace order sent.",
- "OrderID": "123456789"
}
Cancel Order
Sends a cancellation request to the relevant exchange. Request valid for all account types.
path Parameters
orderID required | string Example: 123456789 Order ID for cancellation request. Equity, option or future orderIDs should not include dashes (E.g. |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request DELETE \ --url 'https://api.tradestation.com/v3/orderexecution/orders/123456789' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Message": "Cancel request sent",
- "OrderID": "123456789"
}
Get Activation Triggers
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.
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/orderexecution/activationtriggers' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "ActivationTriggers": [
- {
- "Key": "STT",
- "Name": "Single Trade Tick",
- "Description": "One trade tick must print within your stop price to trigger your stop."
}, - {
- "Key": "STTN",
- "Name": "Single Trade Tick Within NBBO",
- "Description": "One trade tick within the National Best Bid or Offer must print within your stop price to trigger your stop."
}, - {
- "Key": "SBA",
- "Name": "Single Bid/Ask Tick",
- "Description": "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."
}, - {
- "Key": "SAB",
- "Name": "Single Ask/Bid Tick",
- "Description": "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."
}, - {
- "Key": "DTT",
- "Name": "Double Trade Tick",
- "Description": "Two consecutive trade ticks must print within your stop price to trigger your stop."
}, - {
- "Key": "DTTN",
- "Name": "Double Trade Tick Within NBBO ",
- "Description": "Two consecutive trade ticks within the National Best Bid or Offer must print within your stop price to trigger your stop."
}, - {
- "Key": "DBA",
- "Name": "Double Bid/Ask Tick",
- "Description": "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."
}, - {
- "Key": "DAB",
- "Name": "Double Ask/Bid Tick",
- "Description": "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."
}, - {
- "Key": "TTT",
- "Name": "Twice Trade Tick",
- "Description": "Two trade ticks must print within your stop price to trigger your stop."
}, - {
- "Key": "TTTN",
- "Name": "Twice Trade Tick Within NBBO",
- "Description": "Two trade ticks within the National Best Bid or Offer must print within your stop price to trigger your stop."
}, - {
- "Key": "TBA",
- "Name": "Twice Bid/Ask Tick",
- "Description": "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."
}, - {
- "Key": "TAB",
- "Name": "Twice Ask/Bid Tick",
- "Description": "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."
}
]
}
Get Routes
Returns a list of valid routes that a client can specify when posting an order.
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v3/orderexecution/routes' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "Routes": [
- {
- "Id": "AMEX",
- "AssetTypes": [
- "STOCK"
], - "Name": "AMEX"
}, - {
- "Id": "ARCA,",
- "AssetTypes": [
- "STOCK"
], - "Name": "ARCX"
}
]
}
Suggest Symbols
Suggests symbols semantically based upon partial input of symbol name, company name, or description. Does not return Options symbols.
path Parameters
text required | string Symbol text for suggestion. Partial input of a symbol name, company name, or description. |
query Parameters
$top | integer The top number of results to return. |
$filter | string An OData filter to apply to the results. Supports the |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v2/data/symbols/suggest/{text}' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 500
- 502
- 504
[- {
- "Category": "string",
- "Country": "US",
- "Currency": "USD",
- "Description": "string",
- "DisplayType": 0,
- "Error": "string",
- "Exchange": "string",
- "ExchangeID": 0,
- "ExpirationDate": "string",
- "ExpirationType": "string",
- "FutureType": "string",
- "MinMove": 0,
- "Name": "string",
- "OptionType": "string",
- "PointValue": 0,
- "Root": "string",
- "StrikePrice": 0
}
]
Search for Symbols
Searches symbols based upon input criteria including Name, Category and Country.
path Parameters
criteria required | string Criteria are represented as Key/value pairs (
For Equities Lookups:
For Options Lookups:(Category=StockOption, IndexOption, FutureOption or CurrencyOption)
For Futures Lookups:(Category = Future)
For Forex Lookups:
Note:
|
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v2/data/symbols/search/{criteria}' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 502
- 504
[- {
- "Category": "string",
- "Country": "US",
- "Currency": "USD",
- "Description": "string",
- "DisplayType": 0,
- "Error": "string",
- "Exchange": "string",
- "ExchangeID": 0,
- "ExpirationDate": "string",
- "ExpirationType": "string",
- "FutureType": "string",
- "MinMove": 0,
- "Name": "string",
- "OptionType": "string",
- "PointValue": 0,
- "Root": "string",
- "StrikePrice": 0,
- "Underlying": "string"
}
]
Stream Tick Bars
Streams tick bars data for the regular session from a number of bars back, each bar returned separated by interval number of ticks.
path Parameters
symbol required | string A Symbol Name |
interval required | integer [ 1 .. 64999 ] Interval for each bar returned (in ticks). |
barsBack required | integer [ 1 .. 10 ] The number of bars to stream, going back from current time. |
Responses
Request samples
- Shell
- Node
- Python
- C#
curl --request GET \ --url 'https://api.tradestation.com/v2/stream/tickbars/{symbol}/{interval}/{barsBack}' \ --header 'Authorization: Bearer TOKEN'
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 502
- 504
{- "Close": 0,
- "Status": {
- "bit0": 1,
- "bit1": 1,
- "bit2": 1,
- "bit3": 1,
- "bit4": 1,
- "bit5": 1,
- "bit6": 1,
- "bit7": 1,
- "bit8": 1,
- "bit19": 1,
- "bit23": 1,
- "bit24": 1,
- "bit25": 1,
- "bit26": 1,
- "bit27": 1,
- "bit28": 1,
- "bit29": 1
}, - "TimeStamp": "string",
- "TotalVolume": 0
}