Skip to content

Guide

Broker API trading: how it works and how to start

Broker API trading means a program places orders in your brokerage account through an interface the broker publishes, instead of you typing them. Many brokers publish one, including Charles Schwab, Tradier, tastytrade and Alpaca. The API takes orders, but it does not decide when to send them: something still has to read your alerts and place the orders. Nyria is that part for those four brokers, with no code to write.

Official documentation

How to start

  1. 1

    Pick a broker that publishes an API

    Charles Schwab, Tradier, tastytrade and Alpaca each publish one. Robinhood has no public API for stocks and options, so it is not an option for this.

  2. 2

    Decide where the alerts come from

    A TradingView chart, a TrendSpider alert, a Discord server or Telegram chat you run, or a script of your own that calls a webhook URL.

  3. 3

    Choose the receiver

    Write a program that reads each alert, sizes it and calls the broker's order endpoint, or use one that already holds the broker connection. With Nyria, Schwab, Tradier and tastytrade connect through the broker's own sign-in page and Alpaca with an API key.

  4. 4

    Test on paper

    Run the same alerts on Nyria Paper, which is free, and read the Logs tab against the alerts that caused each order.

  5. 5

    Go live small and check the fills

    Deploy a bot on the broker account with a small Budget per entry, and compare every fill with the broker's own order history.

What a broker API gives you

  • It places and cancels orders in your account, and reads positions and balances, once you have authorized access.
  • Authorization differs by broker: a sign-in page at Schwab, Tradier and tastytrade, an API key at Alpaca.
  • Some brokers also publish a sandbox or paper account that works through the same API.

What it does not give you

  • Something to read your alerts. The API waits for an order that something else decides to send.
  • Sizing. Nyria sizes every order from the Budget per entry on the bot, and an alert cannot set it.
  • Upkeep. Tokens expire, and Schwab ends Nyria's access every 7 days, so you sign in again each week.

Questions

Do I need to code to trade through a broker API?
Only if you write the receiver yourself. Nyria is a receiver that already holds the connection to Schwab, Tradier, tastytrade and Alpaca, so a TradingView, Discord or Telegram alert needs no code.
Does Robinhood have a trading API?
Not for stocks and options. Its official Crypto Trading API covers crypto only, and Nyria does not connect to Robinhood.
Can a broker API move my money?
The access Nyria receives places and cancels orders and cannot move money out of the account.
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.