Learn

Schwab API trading bot setup

Updated · Education only

Charles Schwab lets individual customers connect their own software to their brokerage account through the Schwab Trader API. Setting it up takes a few more steps than some other brokers, and Schwab asks you to log in again every 7 days. This guide covers the full setup for the Verus Trading Bot and what to expect week to week.

For a one-screen summary of the requirements, see the Schwab broker page. For how the bot trades once it is connected, read How it works.

What you need

  • An individual (personal) Schwab brokerage account in your own name. Business, LLC, corporate and trust accounts are not supported.
  • Your normal Schwab login, used to sign in to Schwab's developer site and to approve the app.
  • A Mac or Windows computer to run the Verus app on.
  • A Verus Trading Bot plan. Your plan includes any one broker you pick. If Schwab isn't your included broker, add it as an add-on. See Pricing.

If Schwab charges anything for live prices through the API, Schwab sets that price, so check with your broker. Our live-price table links to Schwab's own developer site.

Step 1: Create a Trader API app

Go to developer.schwab.com and sign in. Create a new app and choose the Trader API for individuals (Trader API – Individual). Schwab asks for a callback address. Enter exactly:

  • https://127.0.0.1:8182

This address points back to your own computer. It is where Schwab sends you after you log in, and it is how the app picks up the login. Type it exactly, with https and the port number.

Then wait. Schwab reviews new apps before they work. Until your app is approved, the login step below will not go through. When it is approved, Schwab shows your App Key and Secret on the app's page.

Step 2: Connect Schwab in the app

Install and open the Verus app. If your computer shows a security warning the first time, this guide shows what to click. Accept the agreements, activate your license, and choose Schwab as your broker. Then:

  1. Paste your App Key and Secret from developer.schwab.com.
  2. Press Log in to Schwab. Your browser opens Schwab's login page.
  3. Log in and approve access to your account.
  4. Schwab then sends your browser to a page that won't load. That is expected: it is the callback address on your own computer.
  5. Copy the full address of that page from your browser's address bar. It starts with https://127.0.0.1:8182/?code=
  6. Paste it into the app and finish.

Do this part quickly. The code in that address only lasts a few minutes. If Schwab rejects the login, press Log in to Schwab again and repeat.

Your App Key, Secret and login are saved encrypted on your own computer. They are never sent to us, and we never see your Schwab password.

The 7-day login

Schwab's login for third-party apps lasts 7 days. After that, Schwab asks you to log in again. This is Schwab's rule, and it applies to every app that uses the Trader API, not just ours.

The app keeps track for you:

  • The top bar shows how many days are left, for example "Schwab · 5 days left".
  • Before the login runs out, the main screen warns you. A banner says how many days are left.
  • If the login would run out before the market closes, ARM says to press Renew now first, so the bot doesn't lose its connection mid-day.
  • If it has already run out, the bar says "login expired — press Renew now".

To renew, press Renew now (or go to Settings > Change broker or keys) and repeat the Log in to Schwab steps. It takes a minute. A good habit is to renew on the same day each week, before the market opens.

One stock at a time

On Schwab the bot works one stock at a time. You can keep more stocks on My stocks; the bot works through them in order, top first. Open the Scanner to add stocks, or use Find stocks during market hours to see stocks rated Great, Good or Weak for the bot's style. The scanner never adds a stock by itself.

If you have more than one Schwab account, you can connect each one with Settings > Add broker. Each account gets its own card on the main screen, with its own My stocks, settings, SHADOW / LIVE switch, ARM and STOP. How many accounts you can use depends on your plan and add-ons.

Margin or cash

Use an individual margin account if you can. In a cash account, money from each sale has to settle before the bot can use it again, so the bot can sit idle for much of the day, and the app will say "Waiting for cash to settle". A margin account also lets you borrow, so set "Most money the bot may use" to the amount you actually have if you only want to use your own money. Our margin vs cash guide covers this in more detail.

Set your limits, then practice

Before anything goes live, open Settings and set the most per trade, the most money the bot may use, your daily loss limit and your trading hours. The daily loss limit and the 3:55 PM sell-off are on by default. The safety settings guide explains each one.

Use the app's SHADOW mode to practice. Press ARM in SHADOW for a practice run: real prices, pretend orders. Nothing reaches Schwab. When you are ready for real orders, press STOP, switch to LIVE, answer the question, then press ARM.

If something goes wrong

  • "Schwab didn't answer with your account": log in to Schwab again from Settings > Change broker or keys.
  • "Schwab is an add-on": your license doesn't include Schwab. Add it in the member area.
  • The login page never sends you anywhere: check that your app's callback address is exactly https://127.0.0.1:8182 and that Schwab has approved the app.
  • STOP always works, even without the internet or a license.

Before you trade

Start in SHADOW, start small, and watch your Schwab account alongside the app. Education and software only. Not financial advice. Trading is risky and you can lose money.

Related

See pricing How it works