Connecting Schwab

Connect a Charles Schwab account: create your own Schwab developer app, enter its App Key and Secret, authorize with OAuth, and reconnect when Schwab's weekly token expires.

TigerTradeBot connects to Charles Schwab through Schwab’s trader API using OAuth. You create your own developer application with Schwab, and TigerTradeBot uses its credentials, so the authorization is entirely between you and Schwab.

Through Schwab, TigerTradeBot trades stocks, ETFs and options, and it’s the source for stock charts and stock backtest history.

Prerequisites

Step 1: Register a developer app

  1. Sign in to the Schwab developer portal and create a new app. Name it anything you like.
  2. Request access to Schwab’s Trader API for individuals.
  3. Set the app’s callback URL to the value in TigerTradeBot’s Schwab OAuth Callback URL field (see step 2). The default is https://127.0.0.1. The two must match exactly.
  4. Submit the app. Schwab reviews new apps, and the app must be approved and ready for use before it will work.
  5. Once approved, copy the app’s App Key and Secret.

Step 2: Enter the credentials

  1. Open Settings → Global Configuration → Brokers & Data, section Schwab.
  2. Fill in Schwab App Key, Schwab Secret and Schwab OAuth Callback URL.
  3. Choose Save Settings, then Test Schwab.

Step 3: Authorize

  1. Choose Reconnect Schwab (in the same section).
  2. Choose Open Schwab login, sign in to Schwab and approve access.
  3. Schwab redirects your browser to the callback URL. With the default https://127.0.0.1, that page won’t load, which is expected: copy the full address from the browser’s address bar.
  4. Paste it into the dialog and choose Complete reconnect.

Every 7 days: reconnect

Schwab’s refresh tokens expire after 7 days. That’s Schwab’s policy, not a TigerTradeBot limit. The app warns you when less than a day is left, and the top bar shows Schwab: Reconnect required once it has expired. Repeat step 3 to reconnect.

Paper trading with Schwab

Schwab’s API doesn’t provide a simulated-money environment. Run your instance in Paper mode instead: TigerTradeBot uses your Schwab connection for market data and fills your orders in its built-in simulator. Nothing is sent to Schwab. See Paper trading.

To trade through Schwab, set the instance’s Broker Focus to Schwab (stocks / options) in Settings → Instance Configuration → Trading. Live mode also needs a license that allows live trading.

Troubleshooting

  • The test fails right after you created the app: the app may not have finished Schwab’s review yet.
  • Callback errors: the callback URL in your Schwab app must match the Schwab OAuth Callback URL field exactly.
  • Token errors after a week: expected; reconnect as in step 3.

Trading involves substantial risk of loss and is not suitable for every investor.