Automate TradingView alerts on Tastytrade

Connect Tastytrade once through its OAuth flow, create a bot, and point two TradingView alerts at the bot's buy and sell URLs. Each alert becomes a Tastytrade order in your own account, logged step by step.

Starter $49/mo · Bundle $149/mo · cancel from the dashboard.

How the connection works

Tastytrade uses OAuth. You register an API application with Tastytrade, enter its client ID and secret in Webhook Setup, then approve access on Tastytrade's site. StockAutoTrader stores the resulting tokens and refreshes them automatically when they expire.

Connections can be marked as sandbox, which sends orders to Tastytrade's certification environment. Use it for your first alerts.

Setup, step by step

  1. Start a trial from pricing and sign in.
  2. In Tastytrade's developer settings, create an OAuth application. Set its redirect URI to the one shown in Webhook Setup.
  3. In Webhook Setup, choose Tastytrade, enter the client ID and secret, and click connect. Approve access on Tastytrade.
  4. Create a bot: choose Tastytrade, the ticker, a max dollar amount, and optional default quantities.
  5. Copy the Buy Signal URL and Sell Signal URL.
  6. Create one TradingView alert per side, enable Webhook URL, and paste the matching URL.
  7. Use the example message below. On Tastytrade, always send a price (see why below).
  8. Check the first fills in the bot's trade history before moving off sandbox.

Example alert message

The engine does not fetch a Tastytrade quote on its own, so include the bar close as price. Without a price it can only size from an explicit quantity combined with max_amount.

TradingView alert message (Buy URL)
{
  "price": {{close}},
  "quantity": 5,
  "signal_id": "qqq-buy-{{timenow}}"
}

A sell 0.3% above the close as a limit order, with the share count taken from the bot default:

TradingView alert message (Sell URL)
{
  "price": {{close}},
  "default_sell_percent": 0.3
}

What is supported on Tastytrade

ItemSupported
Asset classUS stocks and ETFs
Order typesMarket, or limit at a % offset from price
Time in forceDay
SidesBuy and sell (separate URLs)
Share quantityWhole shares, up to 10,000 per order
Price sourceAlert price (required for dollar-cap sizing)
AuthenticationOAuth with automatic token refresh
EnvironmentsSandbox or live, per connection
Not supported via webhookOptions, futures, short selling, stop orders, GTC

Fields the bot reads

Optional JSON fields the bot URL reads. Everything else in the message is ignored.
FieldTypeWhat it does
pricenumber or numeric stringReference price. Used for sizing and as the base for limit offsets. TradingView: {{close}}.
quantitynumberShares or coins for this order. Overrides the bot default.
max_amountnumber (USD)Dollar cap for this order. Overrides the bot setting.
default_buy_quantitynumberOverrides the bot default buy quantity.
default_sell_quantitynumberOverrides the bot default sell quantity.
default_buy_percentnumberPlaces a limit buy this % below price. 0 means market.
default_sell_percentnumberPlaces a limit sell this % above price. 0 means market.
signal_idstringIdempotency key. A repeated signal_id is ignored instead of trading twice.

How quantity is decided

  1. quantity from the alert, if present.
  2. Otherwise the bot default buy or sell quantity.
  3. Otherwise max_amount divided by price (whole shares for stocks, up to 8 decimals for crypto).
  4. If no price was sent, the engine asks the broker for a quote where it can (Tradier and Coinbase).
  5. The order is rejected if the result is zero, above 10,000 units, or more than 1% over the dollar cap.

Things to know before going live

  • If Tastytrade rejects an order (buying power, market hours, symbol), the rejection message is stored with the trade so you can see why.
  • If your OAuth approval is revoked, orders fail until you reconnect. Expired access tokens are refreshed automatically.
  • Automatic cancel of stale limit orders is available for Tradier and Coinbase bots, not Tastytrade.

Automated trading can lose money. Not investment advice. A webhook runs whatever your alert says, including a bad alert. Test in a sandbox or at small size first, and watch the audit trail.

Frequently asked questions

Why does the Tastytrade alert need a price?

The engine fetches quotes from Tradier and Coinbase but not from Tastytrade. Sending {{close}} as price lets it size from your dollar cap and compute limit offsets.

Can I trade Tastytrade options or futures from TradingView?

Not through webhook bots today. They place stock and ETF orders only.

Do I have to share my Tastytrade password?

No. You approve access on Tastytrade's own site through OAuth. StockAutoTrader receives tokens, never your password, and you can revoke them from Tastytrade.

Can I test without real money?

Yes. Mark the connection as sandbox to send orders to Tastytrade's test environment first.

Connect a broker and test your first alert

Orders run in your own account. Start on a broker sandbox, read the audit trail, and go live when you decide to.

Automated trading can lose money. Not investment advice.