Automate TradingView alerts on Tradier

StockAutoTrader gives each bot a buy URL and a sell URL. Paste them into two TradingView alerts and each alert becomes an equity order in your own Tradier account, sized by rules you set, with every step written to an audit trail.

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

How the connection works

You connect Tradier with your account ID and an API token from Tradier (Settings, then API Access). The token is used only to place, check, and cancel orders for your bots. Money stays in your Tradier account; StockAutoTrader never holds a balance.

The connection has a sandbox switch, and it is on by default. With it on, orders go to Tradier's sandbox environment instead of your live account. Leave it on until the audit trail shows the bot doing what you expect.

Setup, step by step

  1. Start a trial from pricing and sign in to the dashboard.
  2. Open Webhook Setup, choose Tradier, and enter your account ID and API token. Keep "sandbox" checked for now.
  3. Create a bot: pick Tradier, the ticker (for example SPY), a max dollar amount per trade, and optional default buy and sell quantities.
  4. Copy the bot's Buy Signal URL and Sell Signal URL.
  5. In TradingView, create an alert for your entry condition. Under Notifications, enable Webhook URL and paste the Buy URL.
  6. Create a second alert for your exit condition with the Sell URL.
  7. Paste the example message below into each alert's Message box, or leave it empty to use the bot defaults.
  8. Let a few alerts fire, then review each one in the bot's trade history before switching the connection off sandbox.

Example alert message

The side (buy or sell) comes from which URL the alert calls, and the ticker comes from the bot, so the message only needs sizing hints. This one sends the bar close as the reference price and buys 10 shares:

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

To buy with a limit order 0.5% below the close instead of at market, and let the dollar cap decide the share count:

Limit order sized by a dollar cap
{
  "price": {{close}},
  "max_amount": 2500,
  "default_buy_percent": 0.5
}

An empty message also works. The bot then uses its default quantity, or its max amount divided by a live Tradier quote.

What is supported on Tradier

ItemSupported
Asset classUS stocks and ETFs (Tradier equity class)
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, or a live Tradier quote if none is sent
Cancel stale limitsOptional: cancel this bot's unfilled limit orders before a new one
EnvironmentsTradier sandbox or live, per connection
Not supported via webhookOptions, multi-leg orders, 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

  • Day orders sent outside market hours are handled by Tradier's own rules. Alerts on extended-hours bars may not fill when you expect.
  • If the share price is above your max amount, the order is rejected with a clear message rather than rounded up.
  • A failed broker call is retried once after a short wait. If both attempts fail, the broker error is recorded in the audit trail.
  • If you send the same signal_id twice, the second request is ignored. Use {{timenow}} or a strategy order ID to keep IDs unique.

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

Do I need a Tradier live account to try this?

No. The Tradier connection defaults to sandbox, so you can run alerts against Tradier's sandbox environment first and switch to live only when you choose.

Can I trade options on Tradier with TradingView alerts?

Not today. Webhook bots place equity orders only (US stocks and ETFs). Options and multi-leg orders are not supported through the bot URLs.

Where do I put the ticker in the alert?

You set the ticker on the bot when you create it. The alert message does not need a symbol field, and any symbol in the message is ignored for bot URLs.

What happens if TradingView sends plain text instead of JSON?

The request is acknowledged and ignored, so a malformed message never places a guessed order. Send an empty message or valid JSON.

Does StockAutoTrader hold my money?

No. Orders are placed in your own Tradier account through Tradier's API. You can revoke the API token in Tradier at any time.

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.