TradeStation expert pack for AI agents
Load this into Grok Bot. You can also load it into Claude (as Project knowledge or CLAUDE.md) or a custom GPT. It turns the agent into someone who has already made the TradeStation mistakes, so your agent does not have to. It covers the official TradeStation MCP and the v3 REST API.
These are the lessons and traps. The reference material is in TradeStation's docs (links at the end).
Where each note comes from:
- Untagged: seen on TradeStation's simulator in October 2026.
- [field]: learned in earlier real sessions.
- [docs]: from TradeStation's docs, not re-tested.
Unofficial; no business relationship with TradeStation. Not financial advice. Automated trading can lose money. If this is more than 30 days old, re-check the docs.
Last checked 2026-10-19. Re-check by 2026-11-18.
How an expert works
- The operator picks the trade. You carry it out.
- A plan names the symbol, side, size, order type, price, duration and max loss. A missing field means no send. Never invent a size. No signals.
- The operator can approve a rule once ("buy 1 at 09:35, sell at 15:55") and you repeat it on the simulator. You still never choose the symbol, side or size.
- Use the simulator until the operator turns live trading on. Then rehearse each new order shape on the simulator first.
- Respect the desk limits: max quantity, max notional, orders per day, open positions. Until the operator sets them, send 1 share or 1 contract, one symbol at a time. You can't raise a limit yourself.
- Your checks come first. Then confirm, place and verify. TradeStation's confirm is not a safety net (see below).
- Read the position before every buy or sell, and again after the fill.
- Read a real clock (US Eastern) before choosing the order type and duration. The session decides both.
- If it isn't known, stop and say so. Never invent an endpoint, field, account id, fill or rule.
- Never print or ask for tokens, client secrets, auth codes or passwords. If one gets pasted into the chat, tell the operator to revoke it.
- The kill word is
STOP. Cancel your working orders and end the session.
First-hour traps
Getting access
- MCP access: the operator requests it on the Platforms page of TradeStation's HUB, then connects it in Claude or ChatGPT with OAuth. The server URL is
https://mcp.tradestation.com/v2/mcp. In Claude Code:claude mcp add --transport http tradestation https://mcp.tradestation.com/v2/mcp. - Plan, balance, and the Claude steps, including the TradeStation pages that disagree, are on Connect TradeStation to Claude. This pack stays on the order rules and the traps.
- API access needs a funded TradeStation account.
- The API FAQ says to request a key by email to ClientExperience@tradestation.com.
- The trading-API page listed a promo code and a $10,000 minimum when checked in October 2026. [docs] Read both pages for current terms.
- There's no separate simulator sign-up: the simulator is the same API on
sim-api.tradestation.com.
www.tradestation.comblocks bots. Its pages (MCP setup, API signup, FAQs) return 403 to non-browser fetchers. Ask the operator to open them.
MCP environment
- The MCP starts on live.
get-trading-environmentreadliveon a fresh connection. Before any account call, runset-trading-environmentwithsim(lowercase), read it back, and stop if the read-back isn'tsim. place-orderhas its own environment switch. It's separate from the global setting, so always passenvironment: "SIM"(uppercase there).- MCP market data comes from live, even when trading is set to sim. Quotes report
environment: live. That's fine for reading; orders still go to sim.
Sign-in and tokens (API)
- The
Tradepermission has to be granted at sign-in.- A token was issued without it, and refreshing didn't add it. Only a new browser consent fixes it. [field]
- If you build the authorize URL yourself, check that
Tradeis in the scope list. One kept leaving it out. [field] - A refresh response that lists only
openid offline_accessis normal; it doesn't meanTradewas dropped. [docs] - The MCP has no way to show permissions; the first confirm or place tells you.
- Token lifetimes:
- Access tokens last 20 minutes. Refresh about 10 minutes before a session and right before any burst of orders, not at the moment you need the order. [field]
- On a 401, refresh once and retry once, then stop.
- Refresh tokens don't expire by default. If a refresh returns a new
refresh_token, rotation is on: store the new one. [docs]
/oauth/revokerevokes every refresh token for the API key, not just the one you pass. [docs]
Accounts and the clock
- Match the account to the asset. Margin or Cash for stocks and options, Futures for futures. A mismatch fails with
Invalid account for the asset type. Never type an account id from memory; read it from the accounts call each session. - Simulator accounts are shared. They can hold other sessions' positions and orders. Trade a symbol you have no position in, and never touch anything you didn't place.
- On Windows the shell clock can lie. Git Bash's
TZ=America/New_York dateprinted UTC. Use Pythonzoneinfo(Windows may needpip install tzdata).
MCP or API?
| MCP | API | |
|---|---|---|
| Getting started | Fastest. Sign-in handled for you | You manage OAuth tokens |
| Brackets, OCO, order-sends-order | Not available. confirm-order has no field for them, even though the MCP's built-in guide shows examples | Yes |
| Streaming quotes, orders, positions | No; you poll | Yes |
| Tick sizes (symbol details) | No tool | Yes |
| Responses | Long, with different field names from the API docs | As documented |
Rule of thumb: explore and run supervised simulator sessions on the MCP. Use the API for automated rules, attached stop-losses or targets, and anything that streams.
Order type and duration: the part everyone gets wrong
Stocks
- Regular session (09:30–16:00 ET): any order type works. Default to
DAY. - Pre-market (06:00–09:30) and post-market (16:00–20:00): Limit only, with
DYP(Day+). For several days, useGCPorGDP. - Never send
DAYoutside the regular session. A pre-marketDAYis accepted, then sits inactive until 09:30: a silent miss. [docs] After 16:00,DAYis rejected withNo Day orders after 4:00PM Eastern. [field] - Don't send
DYPfor a normal regular-session order. It keeps working into the post-market. An early-session order went out asDYPby mistake. [field] - Stops don't protect you outside the regular session. Extended hours take limits only, so an exit there is a Limit with
DYP. [field] - Closed (overnight, weekends): nothing executes. Queue a Limit with
GTC/GTD(wakes at 09:30) orGCP/GDP(wakes at 06:00).
Equity options
- Durations:
DAY,GTC,GTD,IOC,FOK,OPG. NeverCLOor the minute durations; both are rejected withInvalid duration. - Plus durations (
DYP/GCP/GDP) only on the select list. TradeStation's extended-hours options page says customers need Day+, GTC+, or GTD+, and the list will be updated twice a year. docs
SPY QQQ IWM GLD XLF NVDA TSLA AAPL MU INTC META AMZN AMD MSFT GOOGL PLTR ORCL AVGO NFLX HOOD GOOG SNDK BAC MRVL BABA TSM NOK F PFE
Confirm also accepts them on other names. Don't send those. Cboe FAQ Q3 says an extended-session order on a class that is not eligible will not be rejected. C1 accepts it, treats it as regular-hours only, ignores the extended-hours designation, and the order rests until 09:30 ET. docs Even on select names, whether a plus-duration order works once placed is unproven.
IOC/FOKwork until 16:17 ET. [docs] Options do not use the stock post-market that runs to 20:00. Select names do have a limit-only window from 16:00 to 16:15 ET.- Select names are limit-only from 07:30 to 09:25 ET and from 16:00 to 16:15 ET. docs docs
Index options (SPX, SPXW, VIX, VIXW, XSP, RUT, RUTW)
- The same durations as equity options, with no plus durations. [docs]
- TradeStation's extended-hours options page lists an early GTH session from 07:15 to 09:25 ET, then a five-minute pause, a regular session from 09:30 to 16:15 ET, and a curb session from 16:15 to 17:00 ET. docs
- Don't send outside 09:30 to 16:15. The GTH and curb windows were not tested.
Futures
- Only
DAY,GTC,GTD,IOC,FOK. Everything else is rejected. - Only tested 09:30–16:00 ET on weekdays. The overnight session and the daily maintenance break aren't documented in the sources, so outside those hours, stop and ask.
Order types: Market, Limit, StopMarket, StopLimit.
- Never
Stop. The MCP offers it, but TradeStation rejects it (Not a valid order confirm object). - Send
Marketonly when the plan says Market, and only in the regular session. A market order leaves no bid, ask or size to check on the receipt. [field] - A trailing stop is
StopMarketplusadvancedOptions.trailingStop(anamountor apercent). A standalone one also needs astopPrice. [docs] Not tested on the simulator.
Changing an order:
- A replace can change only: price, stop, quantity, trailing amount, or the type to
Market. - You can't change the duration with a replace. Cancel and send a new order.
GTD/GDPneed an expiration no more than 90 days out. TradeStation won't stop you from sending more.- GTC orders:
- They're resubmitted every day, so they lose time priority. [docs]
- If one partly fills, the rest is cancelled at the end of the session. [docs]
- Holidays and early closes aren't handled anywhere. Confirm, and read the errors.
Confirm is not a safety net
TradeStation's confirm (MCP confirm-order, API orderconfirm) accepted every one of these:
| It let through | So you must |
|---|---|
| Every stock duration during the regular session, including ones wrong for other sessions | Apply the session rules above yourself |
A 728.005 limit, silently re-priced to 728.01 (a buy rounded up); 1.003 → 1.00; an ES price off the 0.25 tick | Send valid ticks. Compare the price in summaryMessage with the price you sent; stop if they differ |
| SELL 2 shares against a 1-share long; BUYTOCOVER 2 against a 1-share short | Never close more than you hold |
| SELL with no long position; BUYTOCOVER with no short | Only close what exists |
| Plus durations on a non-select option, and on SPX | Use the select list |
| GTD 108 days out | Keep it to 90 days or less |
Lowercase spy, while its own lookup said "Symbol not found" | Use uppercase symbols |
What confirm does catch:
- a duration the asset never takes (
Invalid duration) - the wrong account type (
Invalid account for the asset type) Stop(Not a valid order confirm object)
A confirm can also succeed while its built-in quote or balance lookup fails (Service Unavailable, NotEntitled, Symbol not found). Treat that confirm as having no quote, and pull a fresh quote yourself.
Don't double-send
- A retry after a timeout can place the same order twice. Before resending, check open orders and today's orders, and check your own log for the same order in the last 15 minutes. [field]
- On the API,
OrderConfirmID(1–22 characters) is the server's dedupe key. Build it from the order's details plus the current clock minute (for example, a hash cut to 22 characters), so a retry in the same minute is rejected as a duplicate. [field] - On the MCP, each confirm id places once (valid for 60 minutes). Don't add a second key.
Buying and selling without flipping your position
| Intent | Stock | Option | Future |
|---|---|---|---|
| Open long | BUY | BUYTOOPEN | BUY |
| Close long | SELL | SELLTOCLOSE | SELL |
| Open short | SELLSHORT | SELLTOOPEN | SELL |
| Close short | BUYTOCOVER | BUYTOCLOSE | BUY |
- Read the position first. On the MCP use
get-positions-detailswithaccountsandsymbols: about 200 characters. Notget-positions-summary: about 16,000. SELLSHORTopens a short. It never closes a long.SELLwith no long is not a close.- Futures use
BUY/SELLfor everything, so know whether you're opening or closing. - After the fill, check the order's leg. It says
openOrClose: OpenorClose. A close must come backClose, and the position must be flat, not flipped. In testing, every close and cover came backCloseand flat. - Before shorting:
- A Cash account can't short. [docs]
- Check hard-to-borrow and the account's
IsStockLocateEligible. MCP quotes have noIsHardToBorrowfield, so on the MCP tell the operator you can't check it. - A rejected short stops the session; don't retry larger.
- Close test positions in the same session. A leftover simulator fill is a real position on that account until you close it. [field]
Prices, ticks and combos
- Ticks:
- Stocks move in 0.01.
- ES futures move in 0.25, and one tick is $12.50.
- The quote's
MinMove("25"for ES) is not the tick. - The API has symbol details (
PriceFormat.Increment). The MCP has no symbol-details tool, so for any other product say the tick is unknown and rely on the price check insummaryMessage.
- Multiplier is the quote's
PointValue: equity option 100, ES 50, stock 1. Don't assume 100. - Futures confirm numbers mislead:
estimatedCostis the initial margin, not the contract's full value.- On a market order,
estimatedPricewas about 20 points off the ask. Don't treat it as the fill.
- Multi-leg combos:
- Send a combo as ONE order with
legs. Never as separate single-leg orders: a three-leg position was once opened as three separate orders and left exposed in between. [field] - Price it before you send. [field]
- Conservative net = the buy legs' asks minus the sell legs' bids. Mid = the same calculation on mid prices.
- Don't send if any leg has a missing or zero bid or ask.
- Don't send more contracts than the thinnest leg shows in size.
- A negative limit is a credit.
-1.00came back as "Vertical @ -1.00", with an estimated cost of −100. - Read
summaryMessage. It lists every leg. On the MCP, theorderDefinitionecho comes back blank for combos. - A stock leg inside a combo uses
BUYTOOPEN/SELLTOOPEN, notBUY/SELL. - Combos need the
OptionSpreadspermission and option approval level 3+.
- Send a combo as ONE order with
- Don't trust a quote that is:
- Delayed. The ES quote on a default simulator login was 10 minutes old.
- Halted or restricted.
NotEntitled.
The flags sit in different places by path. MCP: top-level IsDelayed, Halted, Restrictions. API: MarketFlags.IsDelayed, IsHalted, and Restrictions.
Also sanity-check the numbers: one quote briefly showed a 52-week high below the current price.
Keep the quote's TradeTime (UTC), bid and ask with every order, as the price you acted on.
- Data limits:
- Greeks aren't on the regular quote. [field] On the MCP use
get-option-chain-snapshotorget-option-quotes. - MCP
get-barsreturns at most 100 bars, and its only intraday size is 5 minutes.
- Greeks aren't on the regular quote. [field] On the MCP use
Reading what happened (the MCP is not the API)
place-ordersaysorderStatus: "UNKNOWN". That isn't a status.- Poll
get-orders-detailed(by account and symbol, matchingorderId). The real status showed on the first poll, about 5 seconds later. - Poll every 4–5 seconds a handful of times, never in a tight loop.
- If more than 10 orders match, the tool returns a summary instead of details, so add filters.
- Poll
- MCP order records use different fields from the API docs:
- MCP:
orderId,status,filledPrice,rootQuantityRemaining, and legs withbuyOrSell,openOrClose,quantityRemaining, andsymbol.name. There is no per-leg fill price. - API:
OrderID,Status,FilledPrice, and legs withExecQuantity/ExecutionPrice.
- MCP:
- What the statuses mean:
| Code | Meaning | |---|---| | ACK | Received and working | | FLL | Filled. On the simulator, at the market price, which can beat your limit | | OUT (UROut) | Cancelled. A cancel shows OUT, not CAN [field] | | REJ | Rejected. Read StatusDescription; don't resend the same order | | BRO | Broken. Still open, not done | | FLP | Partial fill, rest cancelled. Final | | FPR | Partial fill, still working |
- The MCP's
CXL("cancelled") filter missesOUTorders. To find cancels, read without a status filter. - A price replace keeps the same order id. The response is "Cancel/Replace order sent."
- A run of unexplained
OUTorREJstatuses has happened before. [field] Report it. Don't invent a cause. - Yesterday's order id returns 404 on the today's-orders call. Use historical orders. [field]
- The simulator fills instantly and never partially. Live adds queues, partial fills, and buying-power rejects the simulator never showed. [field]
When things fail
| What happens | What to do |
|---|---|
| 401 | Refresh once, retry once, then stop |
| 429 | Wait X-RateLimit-Reset seconds, retry once, then stop |
| 503 on confirm or place | Don't send. Retry once, then stop. (A 503 only on the confirm's side lookup isn't fatal, once you have a fresh quote yourself) |
| Errors on the confirm | Don't place. Fix the order; don't force it |
| Buying-power reject (live) | Stop. Don't resize and retry |
| Rejected short | Stop. Don't retry larger |
MCP -32602 Invalid arguments | You sent a field the tool doesn't take, an @ symbol, or a bad format |
| Anything else you don't recognize | Stop, cancel your working orders, report |
Going live
- The operator turns live trading on. You don't.
- Bind the live account from the live accounts call.
- Rehearse the exact order shape on the simulator first, and run every check above on the live order too.
- Expect live-only rejects the simulator never gave: buying power on a margin account, and
DAYafter 16:00. [field] - If your host or your rules won't send live orders, write the operator a ticket to place by hand. Include:
- account type, symbol, action, quantity
- order type, limit or stop, duration (and expiration)
- route, session
- the confirm's summary
- quote time, bid and ask
A person places it.
Permissions and expiry
- Option approval levels:
| Level | Allows | |---|---| | 1 | Covered calls, protective puts | | 2 | Adds long calls and puts | | 3 | Adds spreads | | 4 | Adds naked stock puts | | 5 | Adds naked calls and naked index puts |
Simulator enforcement wasn't tested, so a simulator accept isn't proof live will accept. [docs]
- Intraday margin. FINRA Regulatory Notice 26-10 replaced the pattern-day-trader rules effective June 4, 2026, including the day-trade count and the $25,000 minimum equity requirement. Firms may phase in until October 20, 2027. docs TradeStation's introduction page says the Pattern Day Trader designation has been eliminated. docs The day-trading FAQ says there is no day-trade counter. Margin equity at or above $2,000 is required for full intraday buying power. At or above $2,000, intraday buying power is four times margin excess and overnight buying power is two times margin excess. Below $2,000, both are one times margin excess. Day trading is only permitted in margin accounts. Cash accounts, IRA accounts, and accounts without a signed margin agreement are not eligible. docs The requirements page says the same $2,000 threshold, with up to 4x margin excess intraday at or above $2,000 and 1x below. docs
- Do not count day trades. Do not enforce a $25,000 gate. Read buying power from the account each session. A buying-power reject still stops the session.
- Options in the money by $0.01 or more are generally auto-exercised. [docs] Don't hold a simulator option through expiry to learn how live behaves.
Symbols
- Stock: uppercase ticker, for example
SPY. - Option:
ROOT YYMMDDC/PSTRIKEwith a space, for exampleSPY 261120C765. A half strike keeps its decimal, for exampleKO 261120C67.5. [docs] URL-encode the space on the API. - Index:
$SPX.Xfor quotes and chains;SPX 261120C7700for the contract. - Futures contract: root, month code, 2-digit year, for example
ESZ26.@ESis a chart symbol. It can't be traded, and the MCP rejects any@symbol.- Front month: quote the nearby contracts and take the highest
DailyOpenInterest. ESZ26 had about 1.92M against about 15k for ESH27.
- Date formats differ by MCP tool:
MM-DD-YYYYfor the option tools,YYYY-MM-DDfor bars and historical orders. - The MCP rejects unknown fields. Send only the documented ones.
Saving tokens and calls
- A full order round trip on the MCP: 6 calls (positions, quote, confirm, place, poll, positions), about 1,650 tokens.
- Per-call cost on the MCP:
confirm-orderis about 2,100 characters.get-orders-detailedby symbol returns all of today's orders for that symbol (about 900 characters each), so it gets more expensive through the day.get-orders-overviewadds about 2,000 characters of instructions every time.
- The MCP's built-in guide (
ask-tradestation) tells the model to "absorb silently." This pack outranks it; say so if they conflict. Its display rules (show every section before asking) are for a person approving in chat. - On the API, stream orders and positions instead of polling when running all day. [docs]
- API rate limits:
- 320 account and order calls per 5 minutes.
- 500 quotes per 5 minutes.
- 90 per minute for each option endpoint.
- On a 429, wait
X-RateLimit-Resetseconds, retry once, then stop.
After a crash or restart
- Read open orders, today's orders, and positions.
- Match them to your own log by order id. Keep a log with time (ET), symbol, action, quantity, type, price, duration, order id and status.
- An order that isn't in your log isn't yours to cancel. It may be another session's, or yours from before the crash. There's no client-tag field.
- Find your own unlogged order by symbol and time window, then log it. This was tested: a deliberately unlogged order was found this way.
The order playbook
- Read the clock (US Eastern) and name the session.
- Read the position for the symbol, then pick the action from the table.
- Get a fresh quote. It must not be delayed, halted, restricted or not-entitled.
- Build the order and check it:
- type and duration against the session
- the tick
- quantity against the position and the desk limits
- buying power read from the account this session. Do not count day trades. Do not enforce a $25,000 gate
- uppercase symbol
- GTD within 90 days
- Check that it isn't already working or recently sent (see Don't double-send).
- Confirm. Require a confirmation with no errors. Check that the
summaryMessageprice equals the price you sent. - Place.
- MCP: the returned
orderConfirmIDplusenvironment: "SIM"(single use, valid 60 minutes). - API:
POST /v3/orderexecution/orderswith anOrderConfirmIDof 1–22 characters.
- MCP: the returned
- Poll until the status is final. Ignore the
UNKNOWNon the place response. - Re-read the position. On a close, the leg must say
Closeand the position must not have flipped. - Log it with the quote time, bid and ask.
- To change the price, replace it (same id). To change the duration, cancel and resend.
Don't know: stop and ask
- Futures outside 09:30–16:00 ET, and the maintenance break.
- Holidays and early closes.
- Whether plus-duration option orders work once placed.
- What
OPGandCLOdo once placed. - Index options outside 09:30 to 16:15. The extended-hours page lists GTH 07:15 to 09:25 and curb 16:15 to 17:00. Those windows were not tested.
- Whether a combo takes
GTCor onlyDAY. - Trailing stops on the simulator.
- The short-sale locate workflow beyond the account flag.
- Live partial fills.
- Option expiry on a simulator account.
- Ticks for other products on the MCP.
Look it up
- API specification (paths, fields, examples): https://api.tradestation.com/docs/specification/
- Sign-in and tokens: https://api.tradestation.com/docs/fundamentals/authentication/auth-code/
- Simulator vs live: https://api.tradestation.com/docs/fundamentals/sim-vs-live/
- Rate limits: https://api.tradestation.com/docs/fundamentals/rate-limiting/rate-limiting-overview/
- Getting an API key: https://api.tradestation.com/docs/faq/
- Stock durations: https://help.tradestation.com/10_00/eng/tradestationhelp/tb_definitions/trade_bar_durations_equities.htm
- Option durations: https://help.tradestation.com/10_00/eng/tradestationhelp/tb_definitions/trade_bar_durations_options.htm
- Futures symbols: https://help.tradestation.com/10_00/eng/TradeStationHelp/symbology/futures_symbology.htm
- TradeStation FAQs (trading hours, extended-hours orders, day-trading buying power, option exercise; open in a browser): https://www.tradestation.com/faqs/
- Day trading requirements: https://www.tradestation.com/learn/market-basics/stocks-etfs/day-trading-rules/day-trading-requirements/
- Introduction to day trading (no Pattern Day Trader designation): https://www.tradestation.com/learn/market-basics/stocks-etfs/day-trading-rules/introduction-to-day-trading/
- Extended-hours options: https://www.tradestation.com/insights/extended-hours-options-trading/
- FINRA Regulatory Notice 26-10: https://www.finra.org/rules-guidance/notices/26-10
- Cboe equity options extended trading hours FAQ: https://www.cboe.com/document/tech-spec/document/technical-specifications/equity-options-extended-trading-hours-faq/
- MCP (open in a browser): https://www.tradestation.com/platforms-and-tools/mcp/