Guide
How to connect TradingView to the Charles Schwab API
A TradingView alert cannot call the Schwab API. It can only send a webhook, so something has to receive that webhook and place the order through Schwab's Trader API. You can build that receiver yourself on developer.schwab.com, or point the alert at Nyria, which holds the Schwab connection through Schwab's own sign-in with no developer account and no API key. Schwab has no paper account, so test the alert on Nyria Paper first.
Official documentation
Connect TradingView to Schwab with Nyria
- 1
Connect Schwab
In Nyria, select Integrations in the left sidebar, then the Charles Schwab card. Select Connect live account, sign in at schwab.com and select Allow on the Authorize App screen. No developer account or API key is needed.
- 2
Create a strategy
Select Create strategy and pick TradingView as the alert source. Choose stocks or options as the asset type, and set what an entry and an exit do on each side.
- 3
Create the alert in TradingView
Open the alert dialog, set the Condition to your strategy or indicator and paste the message from the strategy's Integration tab. In Notifications, select Webhook URL, paste the strategy's URL and select Create. TradingView sends webhooks on its paid plans only, with two-factor sign-in on.
- 4
Check the format
Back in Nyria, select Check format, then Check and save. The strategy turns Active once Nyria reads every side, and the Logs tab shows the ticker, side and contract it read.
- 5
Run it on Nyria Paper
Deploy a bot on Nyria Paper, set a Budget per entry and let the alert fire for a few sessions. Read the Logs tab against the alerts that caused each order.
- 6
Deploy a bot on Schwab
Deploy a second bot and pick the Schwab account on the Account step. The next alert becomes an order in your own Schwab account.
Building the receiver on the Trader API yourself
- Register an app on Schwab's developer portal and wait for Schwab to approve it. You get a key and a secret.
- Send yourself through Schwab's sign-in once. The access token is short lived, and the refresh token ends after 7 days, so the script needs you to sign in again every week.
- Your program has to accept TradingView's POST on port 80 or 443 and answer within three seconds, work out the size, place the order and read back whether it filled.
- It has to run somewhere that stays on, and a bug in it places real orders.
What Nyria trades at Schwab
- Stocks and options up to 4 legs, as market and limit orders.
- SPX trades on the PM-settled SPXW chain, 0DTE included. Schwab's API offers no crypto or futures.
- An alert cannot set the size. The bot sizes each order from its Budget per entry.
- Schwab ends Nyria's access every 7 days. Select Reconnect live account and sign in again.
Questions
- Does TradingView connect to the Schwab API on its own?
- A TradingView alert only sends a webhook. It never calls the Schwab API itself, so a receiver has to place the order.
- 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.
- Can I test before trading real money at Schwab?
- Schwab has no paper account to connect, so run the same strategy on Nyria Paper, which is free, and then deploy a bot on the Schwab account.
- What does it cost?
- Paper is free. Live trading from $15 a month.
Next
- Paste an alert into the alert tester to see how Nyria reads it.
- Write a TradingView message with the alert builder.
- Step by step for one account: how to automate TradingView to Charles Schwab.
- Step by step for one account: how to automate TradingView to Nyria Paper.
Guides
How to auto execute trades from a TradingView strategy
The alert, the webhook URL, the message, a paper test, then live.
Charles Schwab trading from alerts, no API keys
Schwab's own sign-in, no API keys; what trades there, a worked example, and the paper run first.
Can thinkorswim auto trade?
thinkorswim places an order itself only through conditional orders. Two ways to automate a Schwab account: the Trader API with your own code, or alerts into Nyria.
Test the strategy on a paper bot first
Paper is free. Live trading from $15 a month.