Skip to content

Guide

Can thinkorswim auto trade?

Thinkorswim automated trading: thinkScript's alerts can't reach Nyria. It does not place orders; Nyria trades the Schwab account behind thinkorswim from any outside alert you send.

What thinkScript can and cannot do

thinkScript builds studies, scans, strategies you can backtest and alerts. 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. The one place a thinkScript expression does reach an order is a conditional order: thinkorswim's documentation says an order can be placed or cancelled automatically when a study-based condition is met, and the study must have exactly one plot. That rule belongs to one order you set up in the order entry form. It does not run a strategy, and it cannot read an alert from anywhere else. Read thinkorswim's page on conditional orders and Schwab's developer portal for the sources.

Path one, 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 what thinkorswim lacks

    Your program has to get the alert 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 alert 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 alert 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 on paper, then live

    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 a live 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

Nyria can't connect Schwab's paperMoney, 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

Can thinkorswim auto trade with Nyria?
Through your Schwab account, yes. Rebuild the condition as a TradingView alert, a call in a Discord server you run, or a script of your own.
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 it on paper first

No card required. Paper is free. Live trading from $15 a month.