Skip to main content

Connect Alpaca or Interactive Brokers

Who it’s for
Traders who want to trade US stocks
Assumes
You have an Alpaca or Interactive Brokers account
Applies to
US equity on NASDAQ and NYSE, paper and live

Stretus trades US stocks through Alpaca or Interactive Brokers (IBKR).


Which broker​

AlpacaInteractive Brokers
MarketsUS: NASDAQ, NYSEUS today; other markets are configured but not enabled yet
PaperYes, on the Stretus SimulatorYes, on the Stretus Simulator
LiveYes, once live is enabled for your workspaceYes, once live is enabled for your workspace
How you sign inAn API key and secret you pasteA session your workspace operator runs; nothing to paste

Connect Alpaca​

  1. In your Alpaca dashboard, switch to the Paper account (or your live account) and generate an API key
  2. Copy the Key ID and Secret Key. Alpaca shows the secret once
  3. In Stretus, open Profile > Connect a Broker and choose Alpaca Paper (or Alpaca for live)
  4. Paste the key ID and secret and select Save
Paper and live keys are not interchangeable

A paper key starts with PK and a live key with AK, and the two point at different Alpaca hosts. Stretus checks the key against the account on every request, so a paper key saved on the live connection is refused rather than sent to the wrong account.

Live is switched on per workspace

If Alpaca shows Pending activation, live trading is not enabled for your workspace yet. Ask your workspace administrator.

Your key and secret are stored encrypted and per user. They are never shared with other users or used as a platform-wide key.

Alpaca supports fractional shares: size an order by value instead of by quantity. See Order types by broker.


Connect Interactive Brokers​

IBKR does not use an API key. Stretus connects through an IB Gateway session that your workspace operator keeps signed in, so there is nothing for you to paste.

  1. In Stretus, open Profile > Connect a Broker
  2. Choose IBKR Paper (or IBKR for live) and select Connect

If IBKR shows Pending activation, live trading is not enabled for your workspace yet. Ask your workspace administrator.

One IBKR session per username

IBKR allows one session per username. Signing in to TWS or IBKR Mobile with the same username signs Stretus out, and orders stop until the session is restored.


Market data​

  • Alpaca: live prices come from the free IEX feed, and history from the consolidated (SIP) feed. You do not need to buy a data subscription
  • IEX publishes no pre-market prices, and a few stocks have empty minutes on any day, even in history
  • IBKR: prices on Stretus are not real time

Limitations​

  • Alpaca: 115 US stocks, 65 on NASDAQ and 50 on NYSE
  • Modifying an Alpaca order cancels it and places a new one, so the order ID changes
  • A position Alpaca closes on its side (for example a margin liquidation) can stay open in Stretus until you close it
  • IBKR: US stocks only. A stock that is not yet mapped to IBKR is refused before the order is sent
  • IBKR's other markets (UK, Europe, Australia, UAE) are configured but not enabled yet
  • The same ticker can mean different companies on different exchanges (for example IAG, RIO, AAL). Pick the instrument, not just the ticker

Next​