Guide
PlatformStocksETFsOptionsFuturesForex No key needed

thinkorswim API guide

thinkorswim is where many US traders design strategies, so “thinkorswim API” is a common search. The answer runs through Schwab.

Last verified · Also known as thinkorswim API, thinkScript, TOS API

Quick answer

thinkorswim has no API of its own. thinkScript writes studies, scans and conditional orders inside the platform but cannot run arbitrary code or send orders from outside. To automate a Schwab account, use the Schwab Trader API (the successor of the TD Ameritrade API), which trades the same account thinkorswim shows.

thinkorswim API at a glance

Pricing
Free with a Schwab account
Availability
US and selected countries (Schwab accounts)
Paper trading
Not applicable (data only)
Integration type
OAuth login
In AlgoGP
Design and backtest in AlgoGP, connect the exported code
thinkScript
Studies, scans, alerts, conditional orders (in-app)
External API
Schwab Trader API (OAuth)
Paper
paperMoney inside thinkorswim

Build a thinkorswim strategy with AlgoGP

AlgoGP does not connect to thinkorswim natively yet. thinkorswim authenticates with a browser OAuth login and refreshable tokens, so it needs a one-time manual login step that generated code cannot do on its own.

  1. 1

    Design and backtest in AlgoGP

    Describe the strategy to the copilot and backtest it on years of normalized history. The result does not depend on any vendor.

  2. 2

    Export the Python project

    Every project exports strategy.py, market_data.py, brokers.py and live.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format.

  3. 3

    Plug in thinkorswim

    Implement the four adapter methods (account, positions, submit_market_order and a candle fetcher) with thinkorswim’s SDK, or keep a built-in platform for paper trading and add thinkorswim when you go live.

Built-in data sources for the same markets: Alpaca, Yahoo Finance, Alpha Vantage, OANDA.

thinkorswim API: frequently asked questions

Can thinkScript place trades automatically?

Only as conditional orders inside thinkorswim; it cannot run as an external bot.

How do I automate my thinkorswim account?

Use the Schwab Trader API; orders appear in thinkorswim because it is the same account.

Design and backtest your thinkorswim strategy first

AlgoGP turns an idea into Python and tests it on years of history before you connect it to thinkorswim. The exported code keeps the broker behind four small adapter methods.

  • AI copilot writes and revises the rules
  • Backtests with realistic costs
  • Exported Python ready to wire to thinkorswim

Free plan, no card required.

thinkorswim alternatives

Independent guide. AlgoGP is not affiliated with thinkorswim. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.

Build a strategy