Skip to content

Guide / Checked Nov 2026

How to connect TradingView to Alpaca

Create an API key and secret in your Alpaca dashboard, paper or live. Paste both into Nyria's Alpaca card. Point a TradingView webhook at the strategy, and each alert places an Alpaca order.

Official documentation

Set it up in five steps

  1. 1

    Generate an Alpaca API key

    Sign in at alpaca.markets. Under Paper Trading or Live Trading, select API Keys and generate a key. Copy the key and secret now. The secret is shown once.

  2. 2

    Connect Alpaca to Nyria

    Select Integrations and pick the Alpaca card. Paste the API key and secret. For a paper run, use a Paper Trading key. For live orders, use a Live Trading key from a funded account.

  3. 3

    Make the strategy

    Go to My strategies and select Create strategy. Name it and pick TradingView as the alert source. Nyria shows the strategy's webhook URL. Copy it.

  4. 4

    Wire the TradingView alert

    Create an alert on your chart, indicator or strategy. Write the alert text. Under Notifications, tick Webhook URL, paste the strategy URL and select Apply. The free TradingView plan can't send webhooks.

  5. 5

    Deploy on paper, then live

    Deploy a bot on Alpaca Paper and let a real alert fire. Open the Logs tab and confirm the ticker, side and quantity. Then deploy a bot on the live Alpaca account.

Alert messages for Alpaca

Entry

{ "ticker": "NVDA", "action": "buy" }

Exit

{ "ticker": "NVDA", "action": "sell" }

Limit entry

{ "action": "OPEN", "instrument": "QQQ", "direction": "LONG", "order_type": "limit", "price": 740 }

Buys QQQ with a $740 limit, whatever order type the strategy uses. The bot still sets the size.

Option entry

{ "ticker": "SPY", "action": "OPEN", "direction": "LONG" }

Option exit

{ "ticker": "SPY", "action": "CLOSE", "direction": "LONG" }

TradingView to Alpaca auto trade

  • A TradingView alert can only send its message to a URL.
  • Nyria reads the message and places the order at Alpaca.
  • Nothing in the message sets the size. The budget on the bot does.
  • The Logs tab shows the alert text, the order sent and Alpaca's fill.
  • Alert to order, sub-second.

Paper and live keys

  • Alpaca issues separate paper and live API keys.
  • Connect both and test on paper first.
  • Alpaca paper takes stop, trailing stop, bracket and OCO orders on stocks and ETFs.
  • On live accounts, stops and targets are exit alerts.

What trades at Alpaca

  • US equities, in whole shares.
  • Options, one leg or a spread up to 4 legs.
  • Crypto spot pairs Alpaca lists.
  • Options orders go as Day. Crypto orders go as GTC.
  • Futures aren't offered by Alpaca.

Before you go live

  • Going live takes a Nyria Pro plan, or a Premium strategy you've bought.
  • Nyria picks each contract from the leg rules you set on the strategy.
  • Keep the key and secret out of any shared file.

What it can't do

  • Live Alpaca accounts take market and limit orders.
  • Order forms beyond market and limit on live accounts. Stops and targets are exit alerts.
  • SPX options. Those go to Charles Schwab, Tradier and tastytrade.
  • Futures.
  • A fifth leg, or a ratio spread such as a 1:2:1 butterfly.

Questions

Can I auto trade Alpaca from TradingView?
Yes. Point the alert's webhook at your Nyria strategy. The bot places the Alpaca order.
Can TradingView send orders straight to Alpaca?
Not for alerts. An alert can only send its message to a URL. Nyria reads it and places the order at Alpaca.
Can I run a strategy on Alpaca paper?
Yes. Alpaca issues separate paper and live API keys. Connect both and test on paper first.
Can I trade crypto at Alpaca from a TradingView alert?
Yes, the crypto spot pairs Alpaca lists. Crypto orders go as GTC.
Does Alpaca paper take stop orders from Nyria?
On Alpaca paper, yes, on stocks and ETFs. On live accounts, stops and targets are exit alerts.
What if the alert fires but no order appears?
Open the Logs tab on the bot. Each alert is logged with the reason Nyria placed or refused an order.
What does it cost?
Paper is free. Live trading from $15 a month.

Next

More TradingView to Alpaca guides

Try a paper bot first

No card required. Paper is free. Live trading from $15 a month.