Skip to content

Guide

Alpaca automated trading from alerts

For TradingView Alpaca automation, connect your Alpaca API key in Nyria and paste the Nyria webhook URL into a TradingView alert: each alert fires as an order in your Alpaca account. Nyria also reads TrendSpider, Discord, Telegram and AI agents (MCP) alerts and routes each through Alpaca's API; Nyria places stocks and ETFs in whole shares, options up to 4 legs and crypto spot at Alpaca. You generate a key in Alpaca's dashboard and paste it into Nyria. Nyria Paper is a free first test.

Official documentation

Automate Alpaca with Nyria

  1. 1

    Generate an API key

    In the Alpaca dashboard, switch to Paper or Live and select Generate New Keys. Copy the API key ID and the Secret key; Alpaca shows the secret once.

  2. 2

    Connect Alpaca in Nyria

    Select Integrations, then the Alpaca card, then Connect paper account or Connect live account. Select Accept and continue and paste both values.

  3. 3

    Create a strategy

    Select Create strategy and pick the alert source. Choose stocks, options or crypto and set what an entry and an exit do on each side.

  4. 4

    Test on paper

    Deploy a bot on Nyria Paper or on your Alpaca paper account, set a Budget per entry and read the Logs tab as alerts arrive.

  5. 5

    Deploy a live bot

    Deploy a second bot on the live Alpaca account. A bot on a live account needs a Nyria Pro plan.

Watch the setup

How to automate TradingView alerts to Alpaca
Connect Alpaca and build a TradingView strategy. Check the alert format, deploy a bot.
Steps in the video
  1. 0:00Connect Alpaca. Open Integrations and the Alpaca card. Pick Paper or Live and accept. Paste the API key ID and secret from your Alpaca dashboard.
  2. 0:22Create a strategy. Select Create strategy and name it. Then, select your alert source. This example uses TradingView. Pick stocks and a ticker, then create the draft.
  3. 0:50Create the alert in TradingView. Copy the webhook URL and the alert message from the Integration tab. In TradingView, select Message, paste the message and select Apply. Then select Notifications, tick Webhook URL, paste the URL and select Apply.
  4. 2:32Check the format. Select Check format and add an entry and an exit alert. Nyria shows the ticker, side and order it read.
  5. 2:52Deploy a bot. Select Deploy bot, set a budget per entry and pick an account. Nyria Paper is free, so test there first. On your own Alpaca account, pick it on the Account step. Send a sample alert and watch the paper order fill.

What trades at Alpaca

  • US stocks and ETFs, in whole shares, long and short as the account allows.
  • Options, single legs and spreads up to 4 legs sent as one order. Options trading must be turned on in the Alpaca account. SPX options do not trade at Alpaca.
  • Alpaca stops new orders on contracts expiring that day after 3:15 pm ET, or 3:30 pm ET for broad-based ETFs such as SPY and QQQ. Nyria skips such an entry instead of sending an order Alpaca would refuse.
  • Crypto spot in the pairs Alpaca lists, at any hour.
  • Not offered: futures, extended hours and fractional shares.

How the key is kept

  • Nyria stores the Alpaca API key encrypted at rest.
  • Nyria uses the key to read the account and to place and cancel orders. Revoke the key in the Alpaca dashboard at any time.
  • A paper key works only on paper and a live key only on live.

Four brokers compared

FeatureSchwabAlpacatastytradeTradier
Stocks and ETFsYesYesYesYes
Options, up to 4 legsYesYesYesYes
Order typesMarket and limitMarket and limitMarket and limitMarket and limit
Paper account on NyriaNyria Paper onlyAlpaca paper keys, separate from liveNyria Paper onlyTradier Sandbox
How it connectsSchwab sign-in, renewed every 7 daysAPI key and secrettastytrade sign-inTradier sign-in

Questions

Does Alpaca have a paper account?
Yes. An Alpaca paper account connects the same way as a live one, so one strategy can run on both, each bot in its own size.
Can an alert set how many shares to buy?
No. The bot sizes each order from its Budget per entry.
Can Nyria trade crypto at Alpaca?
Yes, spot only, in the pairs Alpaca lists.
Can one Alpaca key serve paper and live?
No. A paper key works only on paper and a live key only on live, so connect each one on its own.
What does it cost?
Paper is free. Live trading from $15 a month.

Next

Try a paper bot first

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