Skip to content

Guide

Alpaca automated trading from alerts

Alpaca publishes a trading API that places orders in your Alpaca account, paper or live, with an API key. Nyria reads your alerts from TradingView, TrendSpider, a webhook, or a Discord server or Telegram chat you run, and places each as an order through that API. Alpaca trades stocks and ETFs in whole shares, options up to 4 legs and crypto spot. 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.

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.
  • 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.
  • Create the key with trading permission only. Placing and cancelling orders is all Nyria needs.
  • A paper key works only on paper and a live key only on live.

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.
What does it cost?
Paper is free. Live trading from $15 a month.

Next

Test the strategy on a paper bot first

Paper is free. Live trading from $15 a month.