Skip to content

Guide

Can thinkorswim trade automatically?

Not by itself. thinkScript, the scripting language in thinkorswim, builds studies, scans, strategies you can backtest and alerts. It does not place orders: a script can tell you a condition is true, and a person still has to send the order. To automate, something outside thinkorswim has to read the signal and place the order in your Schwab account. There are two ways to do that.

What thinkScript can and cannot do

It can plot a study, filter a scan, run a strategy against history to show where it would have bought and sold, and raise an alert on screen when a condition becomes true. The strategy's entries and exits are drawn for the backtest only. None of it reaches Schwab as an order, so the gap between a signal and a fill is yours to close.

Path one: Schwab's Trader API and your own code

  1. 1

    Register an app with Schwab

    Create an account on Schwab's developer portal, register an app, and wait for Schwab to approve it. You get a key and a secret.

  2. 2

    Authorize it with your Schwab login

    Your code sends you through Schwab's sign-in once and receives tokens. The access token is short lived, and the refresh token ends after 7 days, so a script needs you to sign in again every week.

  3. 3

    Write the part thinkorswim does not have

    Your program has to get the signal from somewhere, work out the size, send the order to the Trader API and read back whether it filled. You also run it somewhere that stays on.

This works with any signal source and gives you full control. It also makes you the maintainer of an order-placing program, and a bug in it places real orders.

Path two: alerts into Nyria

  1. 1

    Connect Schwab with the normal login

    In Nyria, open Integrations, select the Charles Schwab card and select Connect live account. Schwab's own sign-in opens, you select Allow, and you are back. There is no developer account and no key.

  2. 2

    Get the signal out of thinkorswim

    A thinkorswim alert notifies you; it does not call a webhook URL. Rebuild the condition as a TradingView alert, post the call in a Discord server or Telegram chat you run, or have a script of your own call the webhook.

  3. 3

    Deploy a paper bot, then a live one

    A bot on the strategy places each alert as an order. Run it on Nyria Paper first, read the Logs tab, then deploy a second bot on the Schwab account.

Entry, posted in a chat you run

long entry SPY

Exit

exit SPY long

Alerts can be plain text or JSON. They cannot set the size; the bot sizes each order from the budget per entry you chose. At Schwab, Nyria trades stocks and options up to 4 legs with market and limit orders, and attaches no stop order to an entry, so exits come from exit alerts. Schwab ends Nyria's access every 7 days, and you reconnect with the same sign-in. The Schwab guide has the details.

Paper first, on Nyria Paper

Schwab has no paper account to connect, so the test runs on Nyria Paper, the simulated broker built in and free on every plan. Deploy the same strategy there, let real alerts fire for a week or two, and read the Logs tab to see that each message traded what you meant. Then deploy the bot on the Schwab account.

Questions

Does addOrder in thinkScript place real orders?
No. In a thinkScript strategy, addOrder marks hypothetical entries and exits on the chart for a backtest. It sends nothing to Schwab.
Do I need a Schwab developer account for Nyria?
No. You sign in at Schwab as usual and grant Nyria access on Schwab's own authorization screen.
What does it cost?
Paper is free. Live trading from $15 a month.

Test the strategy on a paper bot first

Paper is free. Live trading from $15 a month.