GUIDES

Alpaca API Setup Guide — Connect Alpaca for US Stock Market Data and Automated Trading

Contents
Connect an Alpaca account to TraderWe for US equity market data and order routing. Setup takes about five minutes. The part that decides whether it works well for you is the data feed, so read section 4 before you trade.

1. What you need

- An Alpaca account with API access enabled. - TraderWe installed and running on the PC that will trade. - A decision about market data: Alpaca's free IEX feed, or the paid SIP feed. Section 4 explains what changes.

2. Create the API key

- Sign in at alpaca.markets and open the API keys section of your dashboard. - Generate a key. You get two values: a Key ID and a Secret Key. - The secret is shown once. Copy it before you close the page — if you lose it you have to regenerate the pair.

3. Enter it in TraderWe

Settings → Exchange connections → Alpaca. Four fields:
FieldWhat to put
API Key IDThe key id from step 2
Secret KeyThe secret from step 2
REST Hostapi.alpaca.markets
Data feediex or sip
Press Connect. TraderWe calls the account endpoint once to confirm the credentials before it subscribes to anything. Your secret is encrypted on your own machine with Windows DPAPI, scoped to your user account. It is never sent to us and it is never returned to the screen. Reopening Settings shows a blank field, not your key. About paper trading: leave the REST Host on the live host. TraderWe's paper mode does not route anything to the exchange. It fills orders inside the app against a virtual balance while reading real live prices. That is deliberate. A broker's own paper environment has different queues, different fills and sometimes different data, so results from it do not carry over to live trading. Practise on the live connection in paper mode instead.

4. Choose your data feed — this is the important part

Alpaca offers two feeds and they are not small variations of each other. SIP (paid) is the consolidated tape. Every US venue, real-time, including pre-market and after-hours prints. IEX (free) is a single exchange. IEX is one venue among many and prints a small single-digit share of US volume, so on the free feed you see a thin sample of what actually traded. What that means inside TraderWe: - On IEX the connection badge shows Degraded, not Connected. That is not a fault. It is telling you the data is partial so you never mistake a thin tape for a quiet market. - Pre-market and after-hours are effectively empty on IEX. We measured this on 2026-08-07: one-minute bar requests for 04:00–06:00 ET came back with nothing at all. - Because of that, the universe scanner cannot rank pre-market movers on the free feed. It will tell you so rather than showing a stale list. If you only trade the regular session and you are researching rather than scalping, IEX is usable. If your strategy depends on pre-market, or on seeing every print, you need SIP. TraderWe checks your entitlement when you connect. If you select SIP without a subscription, Alpaca answers that your subscription does not permit it and we fall back rather than failing the connection.

5. Check it worked

- The connection badge reads Connected (SIP) or Degraded (IEX). - Quotes tick on your watchlist during market hours. - Percent change is not stuck at 0. If it is, see the first entry in section 7.

6. Orders

TraderWe routes four order types to Alpaca:
TypeSent asNeeds
Marketmarket
Limitlimitlimit price
Stopstopstop price
Stop limitstop_limitboth prices
Time in force is sent as you set it — DAY, GTC, IOC or FOK. If you pick something Alpaca does not accept, the order is refused with a message rather than quietly downgraded to something else. Extended-hours orders are supported. When a limit order goes out while the regular session is closed, TraderWe marks it for extended-hours execution so it can fill in pre-market or after-hours instead of resting until 09:30. Alpaca's rule is that this only works for limit orders with DAY validity, so market orders outside the session are converted to limit orders first — a market order in thin pre-market has no price control at all. Two things to know about how fills are reported: - Alpaca's order response tells us the immediate outcome. A limit order that fills much later can take a moment to show as filled, because we learn it by asking rather than being pushed. - Order routing stays locked until you arm it. Until then, strategies run in paper mode and fill inside TraderWe against live Alpaca prices.

7. What this connection does not give you

- No order book depth. Alpaca's stream carries trades and quotes only, so level-2 ladders and any rule that reads depth will not work here. Use IBKR or a crypto exchange if you need depth. - Up to 30 symbols streamed at once. - Trade strength is computed by TraderWe from the tape, because Alpaca does not publish it.

8. Common problems

Percent change shows 0 for everything. Alpaca's stream sends trades and quotes but never yesterday's close, so there is nothing to compute a change against. TraderWe fetches the previous close over REST when you subscribe and refreshes it when the date rolls over. If you see zeros, you are on a build from before 2026-08-06, update. Connected, but pre-market is empty. You are on the IEX feed. See section 4. This is a data subscription limit, not a connection problem. The connection stops at "API key required". The host answered but rejected the credentials. Check for a stray space at the end of the pasted key, and confirm the key has not been regenerated in the dashboard. The badge went from Connected to Degraded on its own. You selected SIP but the entitlement check did not pass. Confirm the subscription is active on your Alpaca account. An order came back refused with a message about time in force. You chose a validity Alpaca does not accept for that order type. Extended-hours orders in particular must be limit orders with DAY validity. Limitations - Everything above is about the US equity connection. Alpaca's crypto endpoints are not used by TraderWe. - The pre-market measurement in section 4 is from a single session on 2026-08-07. It matches Alpaca's documented free-plan behaviour, but it is one observation, not a survey across many days. - Feature availability and pricing on the Alpaca side can change; verify on their site before subscribing.

Related reading

← All guides

Originally published by TraderWe on July 10, 2026. You may quote and link to this page. Republishing the full text without a link back to the original is not permitted.

5 replies

I
IndicatorSkeptic· Jul 2026 ago
Article promises section 4 will explain the feed choice and then the extract cuts off right when it gets to paper trading, which is peak documentation energy. Still, nice to see someone admit up front that the data feed is the actual decision and the key entry is trivia.
N
NightOwl_Yuki· Jul 2026 ago
the DPAPI bit is the part i actually care about, since my box runs unattended overnight. good that reopening settings shows blank instead of the key sitting there in plain text.
M
MomoQueen· Jul 2026 ago
five minutes to connect, sure, but the free feed vs paid feed thing is where people are gonna get bitten!! if your fills look weird on thin names that's your answer!!
MLcurious· Jul 2026 ago
Honest question — if I backtest on one feed and then go live on the other, are my results even comparable? I assumed data was data but this guide makes it sound like the feed changes what you actually see, and I don't know how to check that without just running both side by side for a while. Also does the paper host use the same feed setting or is that separate?
I
IndicatorSkeptic· Aug 2026 ago· edited Aug 2026 ago
"Read section 4 before you trade" and then the post gets cut off right at the good bit, classic. But sure, I'll bite: IEX is a fraction of the tape, so your "volume" is a rumour and your 1min candle wicks are whatever IEX happened to see. Doesn't bother me much since I trade levels off the chart and not some volume oscillator, but if your setup depends on volume confirmation you're confirming nothing on the free feed.
Sign in to reply →