Places and manages orders via the Alpaca Broker API — create, replace, cancel orders, list positions, and check buying power for end-user accounts.
Ships in alpaca-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Place, modify, cancel, and track orders for an end-user account, and read positions & buying power. The defining feature of Broker API trading: account_id is in the path — you act for a user account, not your own.
Read
alpaca-broker-integrationfirst for base URLs and auth (client-credentials Bearer token; legacy Basic still works). (The standalone Trading API uses/v2/orderswith no account in the path; everything else here transfers.)
https://docs.alpaca.markets/docs/orders-at-alpaca, https://docs.alpaca.markets/docs/fractional-tradinghttps://docs.alpaca.markets/reference/postorderalpaca-docs MCP → get-endpoint title "Broker API" path /v1/trading/accounts/{account_id}/orders| Method | Path | Purpose |
|---|---|---|
| POST | /v1/trading/accounts/{id}/orders | Create order |
| GET | /v1/trading/accounts/{id}/orders | List orders (filter by status, symbols, after…) |
| GET | /v1/trading/accounts/{id}/orders/{order_id} | Get order by ID |
| GET | /v1/trading/accounts/{id}/orders:by_client_order_id?client_order_id=… | Get by your client ID |
| PATCH | /v1/trading/accounts/{id}/orders/{order_id} | Replace (modify) order |
| DELETE | /v1/trading/accounts/{id}/orders/{order_id} | Cancel one order (204) |
| DELETE | /v1/trading/accounts/{id}/orders | Cancel all (207 Multi-Status) |
| POST | /v1/trading/accounts/{id}/orders/estimation | Cost-estimate an order |
| GET / DELETE | /v1/trading/accounts/{id}/positions[/{symbol_or_asset_id}] | List / close positions |
| GET | /v1/trading/accounts/{id}/account | Trading-account details (buying power etc.) |
Schema-required: type and time_in_force. Conditionally required: symbol, side, and exactly one of qty/notional.
// notional market buy (dollar-based, fractional)
{ "symbol": "AAPL", "notional": "25.00", "side": "buy", "type": "market", "time_in_force": "day",
"client_order_id": "your-own-uuid" }
// limit qty sell
{ "symbol": "AAPL", "qty": "3", "side": "sell", "type": "limit", "limit_price": "190.00", "time_in_force": "gtc" }
| Field | Values / notes |
|---|---|
symbol | required (except mleg multi-leg options) |
qty | decimal string, up to 9 dp; fractionable only for market+day per the order schema |
notional | decimal string, up to 2 dp. Mutually exclusive with qty |
side | buy, sell (plus advanced: sell_short, …) |
type | market, limit, stop, stop_limit, trailing_stop |
time_in_force | day, gtc, opg, cls, ioc, fok |
limit_price / stop_price | required for limit/stop variants |
trail_price / trail_percent | one required for trailing_stop |
extended_hours | bool; only with type=limit and TIF day/gtc |
client_order_id | ≤128 chars; your idempotency key (auto-generated if omitted) |
order_class | simple (default), bracket, oco, oto, mleg |
take_profit / stop_loss | {limit_price} / {stop_price, limit_price?} for bracket/oco/oto |
position_intent | buy_to_open, sell_to_close, … |
qty XOR notional (verbatim rule): pass one or the other — supplying both → 400. In the response, whichever you didn't use comes back null.
fractionable: true (check the Assets API — see alpaca-broker-market-data), else requested asset is not fractionable.day for fractional/notional.market and limit (day); only limit for extended hours.notional, 9 for qty (Broker API FAQ, "What is the precision for notional and qty"; the order schema's "2 decimal points" on qty is stale). Eligible types: the order schema says fractional qty only on market+day; the Fractional Trading guide also accepts limit/stop/stop_limit at TIF day — confirm in sandbox before relying on the wider set.OrderStatus (the order object's status): new, partially_filled, filled, done_for_day, canceled, expired, replaced, pending_cancel, pending_replace, accepted, pending_new, accepted_for_bidding, stopped, rejected, suspended, calculated.
Order
status≠ trade-eventevent. The order object'sstatusis the enum above. The SSE trade-update stream reports a richereventenum that adds operational events with no Broker order status —trade_bust,trade_correct,restated,order_cancel_rejected,order_replace_rejected.heldis both: a trade event, and anOrderStatusin the Trading API enum though not in the Broker one, so don't assume the two enums match. Seealpaca-broker-sse-events.
Terminal: filled, canceled, expired, rejected (and replaced for the original order). Everything else is in-flight.
Early-state distinctions (these trip people up):
accepted — received by Alpaca, not yet routed to a venue (common outside market hours).new — received and routed to exchanges; the usual initial live state.pending_new — routed but not yet accepted for execution (rare).An order usually reaches new directly; accepted/pending_new are rare intermediates. Lesson: treat new/accepted/pending_new as "exists but not done." Persist the order on submit, then update on fill/cancel/reject events — don't block the user waiting for a terminal state synchronously.
Position key fields: symbol, asset_id, qty, qty_available (free of open orders), side (long/short), avg_entry_price, market_value, cost_basis, unrealized_pl, unrealized_plpc, current_price, change_today.
TradeAccount key fields:
buying_power (with margin multiplier 1–4), cash, cash_withdrawable, equity, last_equity.trading_blocked, account_blocked, transfers_blocked, trade_suspended_by_user.multiplier, regt_buying_power, non_marginable_buying_power, long_market_value, initial_margin, maintenance_margin, sma.Lesson — check buying power before notional orders. For a "spend $X" UX, read buying_power/cash first and reject/notify on insufficient funds, rather than letting Alpaca reject the order. Re-read it after every accepted order — each one consumes buying power.
PDT/day-trade fields are gone following FINRA's intraday-margin rule change:
daytrade_count,pattern_day_trader,daytrading_buying_powerandbod_dtbpare absent from the currentTradeAccountschema, as are thedtbp_check/pdt_checkconfigurations. Don't code against them.
422; sells are exempt.asset_class — crypto rejects time_in_force: day (only gtc/ioc) and allows only market/limit/stop_limit; options allow day/gtc only. Check the type/TIF matrix in the OrderType/TimeInForce descriptions at https://docs.alpaca.markets/reference/createorderforaccount rather than assuming the equity set.bracket/oco/trailing_stop for simultaneous take-profit + stop-loss — they're exempt.take_profit.limit_price and stop_loss.stop_price; TP must be above SL for a buy; no extended hours; TIF day/gtc; child legs activate only after the entry fully fills; canceling one cancels the group.qty can't be changed on replace ("full shares only").200 from PATCH can still be rejected if the original fills first; watch the trade-updates stream. Can't replace while accepted/pending_new/pending_cancel/pending_replace.204, or 422 if no longer cancelable; cancel-all → 207 per-order results; close-all positions → 207. Close-single accepts mutually-exclusive qty or percentage.client_order_id from your own transaction record. It's your dedup key and lets you look the order up (orders:by_client_order_id) if the create response is lost. Note it dedups lookup, not necessarily replay — combine it with a local "already-submitted?" guard.notional market/day order per instruction → record the returned order → mark the instruction done only after a successful create. On insufficient funds, skip this run and surface it; whether to cancel a standing instruction is a product decision. Schedule the batch shortly before market open and respect the market clock (alpaca-broker-market-data).alpaca-broker-sse-events.Related skills: prices/assets/clock → alpaca-broker-market-data; fills in real time → alpaca-broker-sse-events; rate limits on bulk placement → alpaca-broker-rate-limits-resilience; money formatting → alpaca-broker-money-precision.
What SKILL.md sets; muted values are Claude Code's defaults
/alpacahq-alpaca-skills:alpaca-broker-trading-ordersfrom alpaca-skills
Generated from the plugin's indexed repository (alpacahq/alpaca-skills) — no native marketplace selected
npx claudepluginhub p/alpacahq-alpaca-skills14 skills in this plugin
/alpaca-broker-account-onboardingOpen and manage brokerage accounts via the Alpaca Broker API — account creation, KYC/CIP, identity & disclosures, agreements, document upload (incl. W-8BEN), account status lifecycle, and account updates/closure. Use when a developer is building onboarding, KYC, or account-management flows on Alpaca in any language./alpaca-trading-backtestExecute deterministic, reproducible historical backtests from a start date, end date, and strategy concept using the Alpaca CLI plus agent-written workspace code. Use when the user wants to backtest a strategy, simulate historical trades, or return trades, diagnostics, and reproducibility artifacts.
/alpaca-broker-funding-transfersMove money between an Alpaca brokerage account and the EXTERNAL banking world via the Broker API — ACH relationships, wire recipient banks, classic transfers (deposits/withdrawals), the v1beta funding wallet (international/instant), transfer status lifecycles, and fees. Use when building deposit/withdrawal flows or connecting external bank accounts on Alpaca in any language. For moving cash/shares BETWEEN accounts inside your own omnibus, use journals instead./alpaca-broker-integrationEntry point for integrating with the Alpaca Broker API (plus Market Data and Trading APIs) in any programming language. Use when a developer wants to build on Alpaca — open brokerage accounts, run KYC, fund accounts, move money via journals, place orders, consume real-time event streams, or pull market data — and need to know base URLs, auth, conventions, or which focused sub-skill to use./alpaca-broker-journalsMove cash (JNLC) and securities (JNLS) BETWEEN accounts inside your own Alpaca omnibus via the Broker API — single, batch, and reverse-batch journals, the Idempotency-Key header, journal status lifecycle including corrections, and the firm/sweep-account pattern that powers instant funding and share rewards. Use for internal account-to-account movement in any language. For deposits/withdrawals to EXTERNAL banks, use funding-transfers instead./alpaca-broker-market-dataPull and stream US stock market data from Alpaca — REST snapshots/bars/trades/quotes, historical bars with timeframes and feeds (IEX vs SIP), the assets master list, market clock & calendar, news, and the real-time WebSocket stream. Use when building charts, quotes, price feeds, or asset metadata on Alpaca in any language.Other plugins' skills for the same job