Creator · alpacahq
Last updated · Sep 4, 2026
Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest
Creator · alpacahq
Last updated · Sep 4, 2026
Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest
Creator · alpacahq
Last updated · Sep 4, 2026
Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest
Creator · alpacahq
Last updated · Sep 4, 2026
Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest
Sandbox only
Install targets
Codex install prompt
Install the "alpaca-broker-trading-orders" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/trading-orders. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest, or portfolio flows on Alpaca in any language. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"alpacahq-alpaca-broker-trading-orders","task":"Install alpaca-broker-trading-orders","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Design assets, images, video, audio, multimodal media, presentation, and creative production skills.
Scenario
Design and creative
I need my agent to produce design assets, UI directions, presentations, or creative media workflows.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Maintenance
fresh
3d since push
Risk
Risky
Permission surface may require sandboxing
GitHub quality
142
68/100 Quality · 75/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Financial research output is not financial advice; require human review before any live investment decision
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
PromisingUseful candidate, but compare it with alternatives before adopting.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
RiskyA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
142 GitHub stars
Repo activity
142 stars, 17 forks
Maintenance
3d since push
License
Apache-2.0
Install
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-ordersDo not use when
Alternative
174.2K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.4K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
174.2K Stars
npx skills add anthropics/skills --skill canvas-design
Alternative
174.2K Stars
npx skills add anthropics/skills --skill brand-guidelines
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
medium
Skill may inspect schemas, query databases, or work with persistent stores.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20alpaca-broker-trading-orders%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20alpaca-broker-trading-orders%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/alpacahq-alpaca-broker-trading-orders/install
Agent should check
Copy prompt
Task: Use alpaca-broker-trading-orders in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20alpaca-broker-trading-orders%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-trading-orders/install
Install command: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/alpacahq-alpaca-broker-trading-orders/install
LLM text format
/api/skills/alpacahq-alpaca-broker-trading-orders/install?format=text
Find alternatives
/api/skills/search?q=alpaca-broker-trading-orders&limit=3
Agent prompt
Use alpaca-broker-trading-orders for this task. Review https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-trading-orders/install, then install with: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-ordersRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/alpacahq-alpaca-broker-trading-orders
LLM text
/api/registry/manifest/alpacahq-alpaca-broker-trading-orders?format=text
Install alias
/api/registry/install/alpacahq-alpaca-broker-trading-orders
Recommend
/api/registry/recommend?task=Use%20alpaca-broker-trading-orders%20in%20an%20agent%20workflow&limit=3
Agent fit
Finance and quant
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Prototype with this skill first; keep a fallback candidate ready.
Role in stack
Fallback candidate
Primary fit
Finance and quant
Trust label
Prototype first
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO142 GitHub stars
Stars/forks activity
CHECK142 stars, 17 forks; issue activity unavailable in current metadata
Recent maintenance
PASS3d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Useful candidate, but compare it with alternatives before adopting.
Workflow fit
Analyze markets
I need my agent to analyze markets, financial data, filings, portfolios, and quant strategies.
Create assets
I need my agent to produce design assets, UI directions, presentations, or creative media workflows.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Workflow fit
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
--- name: alpaca-broker-trading-orders description: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest, or portfolio flows on Alpaca in any language. ---
# Alpaca Broker API — Trading on Behalf of Accounts
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-integration` first. Broker API + HTTP Basic auth. (The standalone Trading API uses `/v2/orders` with no account in the path; everything else here transfers.)
## Reference - Guides: `https://docs.alpaca.markets/docs/orders-at-alpaca`, `https://docs.alpaca.markets/docs/fractional-trading` - API ref: `https://docs.alpaca.markets/reference/postorder` - Live schema: `alpaca-docs` MCP → `get-endpoint` title `"Broker API"` path `/v1/trading/accounts/{account_id}/orders`
## 1. Endpoints
| 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.) |
## 2. Create-order request
Schema-required: `type` and `time_in_force`. Conditionally required: `symbol`, `side`, and exactly one of `qty`/`notional`.
```json // 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. Fractional only for `market`+`day` | | `notional` | decimal **string**, up to 9 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`.
## 3. Fractional / notional rules
- **On by default** for all accounts (live + paper). - Asset must have **`fractionable: true`** (check the Assets API — see `alpaca-broker-market-data`), else `requested asset is not fractionable`. - **TIF must be `day`** for fractional/notional. - **Notional** is limited to `market` and `limit` (day); only `limit` for extended hours. Fractional `qty` additionally allows `stop`/`stop_limit` per the guide. - **No shorting fractional** — all fractional sells are marked long. - Precision: up to **9 decimal places** for both `qty` and `notional`.
## 4. Order status lifecycle
`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-event `event`.** The order object's `status` is the enum above. The **SSE trade-update stream** reports a *richer* `event` enum that adds operational events not present as a status — including `held` (multi-leg secondary legs awaiting trigger), `trade_bust`, `trade_correct`, `restated`, `order_cancel_rejected`, `order_replace_rejected`. So `held` exists as a trade *event* but never as an order *status*. See `alpaca-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).
So the typical opening sequence is `accepted → pending_new → new`, then fills. **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.
## 5. Positions & trading account
**`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`. - Blockers: `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. (Cache it per account within a batch run to avoid re-fetching.)
> **PDT/day-trade fields are deprecated** (since 2026-04-27, sunset 2026-07-06) following FINRA's intraday-margin rule change: `daytrade_count`, `pattern_day_trader`, `daytrading_buying_power`, `bod_dtbp`, plus config `dtbp_check`/`pdt_check`. They still exist in the schema today but stop relying on them.
## 6. Documented gotchas
- **Wash-trade rejection (403):** if a user's two orders could self-cross (opposite sides, crossable prices), Alpaca rejects. Opposing market/stop pairs are always rejected; opposing limits rejected when buy-limit ≥ sell-limit. **Use `bracket`/`oco`/`trailing_stop` for simultaneous take-profit + stop-loss** — they're exempt. - **Bracket constraints:** requires both `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. - **Notional orders can't be replaced** — cancel and resubmit (IPO-class notional is the exception). Fractional `qty` can't be changed on replace ("full shares only"). - **Replace ≠ guaranteed:** a `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`. - **Cancel semantics:** single cancel → `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`.
## 7. Idempotency & recurring-invest lessons
- **Always set `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. - **Recurring/scheduled buys (lesson):** the robust pattern is — fetch pending invest instructions from your DB → check buying power → place a `notional` `market`/`day` order per instruction → record the returned order → mark the instruction done **only after** a successful create. On insufficient funds, cancel the instruction and notify, don't silently skip. Schedule the batch shortly **before** market open and respect the market clock (`alpaca-broker-market-data`). - Track fills via the **trade events SSE stream**, not by polling each order — see `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`.
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for alpaca-broker-trading-orders, ready for a manual X post.
alpaca-broker-trading-orders: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty... 142 stars https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=x
Listing + install path for alpaca-broker-trading-orders: https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=x Install: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to alpacahq but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders/audit)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)alpacahq
@alpacahq
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.2K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.4K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.2K StarsAnthropic Brand Guidelines
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
174.2K StarsSandbox only
Install targets
Codex install prompt
Install the "alpaca-broker-trading-orders" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/trading-orders. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest, or portfolio flows on Alpaca in any language. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"alpacahq-alpaca-broker-trading-orders","task":"Install alpaca-broker-trading-orders","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Design assets, images, video, audio, multimodal media, presentation, and creative production skills.
Scenario
Design and creative
I need my agent to produce design assets, UI directions, presentations, or creative media workflows.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Maintenance
fresh
3d since push
Risk
Risky
Permission surface may require sandboxing
GitHub quality
142
68/100 Quality · 75/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Financial research output is not financial advice; require human review before any live investment decision
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
PromisingUseful candidate, but compare it with alternatives before adopting.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
RiskyA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
142 GitHub stars
Repo activity
142 stars, 17 forks
Maintenance
3d since push
License
Apache-2.0
Install
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-ordersDo not use when
Alternative
174.2K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.4K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
174.2K Stars
npx skills add anthropics/skills --skill canvas-design
Alternative
174.2K Stars
npx skills add anthropics/skills --skill brand-guidelines
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
medium
Skill may inspect schemas, query databases, or work with persistent stores.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20alpaca-broker-trading-orders%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20alpaca-broker-trading-orders%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/alpacahq-alpaca-broker-trading-orders/install
Agent should check
Copy prompt
Task: Use alpaca-broker-trading-orders in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20alpaca-broker-trading-orders%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-trading-orders/install
Install command: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/alpacahq-alpaca-broker-trading-orders/install
LLM text format
/api/skills/alpacahq-alpaca-broker-trading-orders/install?format=text
Find alternatives
/api/skills/search?q=alpaca-broker-trading-orders&limit=3
Agent prompt
Use alpaca-broker-trading-orders for this task. Review https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-trading-orders/install, then install with: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-ordersRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/alpacahq-alpaca-broker-trading-orders
LLM text
/api/registry/manifest/alpacahq-alpaca-broker-trading-orders?format=text
Install alias
/api/registry/install/alpacahq-alpaca-broker-trading-orders
Recommend
/api/registry/recommend?task=Use%20alpaca-broker-trading-orders%20in%20an%20agent%20workflow&limit=3
Agent fit
Finance and quant
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Prototype with this skill first; keep a fallback candidate ready.
Role in stack
Fallback candidate
Primary fit
Finance and quant
Trust label
Prototype first
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO142 GitHub stars
Stars/forks activity
CHECK142 stars, 17 forks; issue activity unavailable in current metadata
Recent maintenance
PASS3d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Useful candidate, but compare it with alternatives before adopting.
Workflow fit
Analyze markets
I need my agent to analyze markets, financial data, filings, portfolios, and quant strategies.
Create assets
I need my agent to produce design assets, UI directions, presentations, or creative media workflows.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Workflow fit
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
--- name: alpaca-broker-trading-orders description: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest, or portfolio flows on Alpaca in any language. ---
# Alpaca Broker API — Trading on Behalf of Accounts
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-integration` first. Broker API + HTTP Basic auth. (The standalone Trading API uses `/v2/orders` with no account in the path; everything else here transfers.)
## Reference - Guides: `https://docs.alpaca.markets/docs/orders-at-alpaca`, `https://docs.alpaca.markets/docs/fractional-trading` - API ref: `https://docs.alpaca.markets/reference/postorder` - Live schema: `alpaca-docs` MCP → `get-endpoint` title `"Broker API"` path `/v1/trading/accounts/{account_id}/orders`
## 1. Endpoints
| 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.) |
## 2. Create-order request
Schema-required: `type` and `time_in_force`. Conditionally required: `symbol`, `side`, and exactly one of `qty`/`notional`.
```json // 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. Fractional only for `market`+`day` | | `notional` | decimal **string**, up to 9 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`.
## 3. Fractional / notional rules
- **On by default** for all accounts (live + paper). - Asset must have **`fractionable: true`** (check the Assets API — see `alpaca-broker-market-data`), else `requested asset is not fractionable`. - **TIF must be `day`** for fractional/notional. - **Notional** is limited to `market` and `limit` (day); only `limit` for extended hours. Fractional `qty` additionally allows `stop`/`stop_limit` per the guide. - **No shorting fractional** — all fractional sells are marked long. - Precision: up to **9 decimal places** for both `qty` and `notional`.
## 4. Order status lifecycle
`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-event `event`.** The order object's `status` is the enum above. The **SSE trade-update stream** reports a *richer* `event` enum that adds operational events not present as a status — including `held` (multi-leg secondary legs awaiting trigger), `trade_bust`, `trade_correct`, `restated`, `order_cancel_rejected`, `order_replace_rejected`. So `held` exists as a trade *event* but never as an order *status*. See `alpaca-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).
So the typical opening sequence is `accepted → pending_new → new`, then fills. **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.
## 5. Positions & trading account
**`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`. - Blockers: `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. (Cache it per account within a batch run to avoid re-fetching.)
> **PDT/day-trade fields are deprecated** (since 2026-04-27, sunset 2026-07-06) following FINRA's intraday-margin rule change: `daytrade_count`, `pattern_day_trader`, `daytrading_buying_power`, `bod_dtbp`, plus config `dtbp_check`/`pdt_check`. They still exist in the schema today but stop relying on them.
## 6. Documented gotchas
- **Wash-trade rejection (403):** if a user's two orders could self-cross (opposite sides, crossable prices), Alpaca rejects. Opposing market/stop pairs are always rejected; opposing limits rejected when buy-limit ≥ sell-limit. **Use `bracket`/`oco`/`trailing_stop` for simultaneous take-profit + stop-loss** — they're exempt. - **Bracket constraints:** requires both `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. - **Notional orders can't be replaced** — cancel and resubmit (IPO-class notional is the exception). Fractional `qty` can't be changed on replace ("full shares only"). - **Replace ≠ guaranteed:** a `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`. - **Cancel semantics:** single cancel → `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`.
## 7. Idempotency & recurring-invest lessons
- **Always set `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. - **Recurring/scheduled buys (lesson):** the robust pattern is — fetch pending invest instructions from your DB → check buying power → place a `notional` `market`/`day` order per instruction → record the returned order → mark the instruction done **only after** a successful create. On insufficient funds, cancel the instruction and notify, don't silently skip. Schedule the batch shortly **before** market open and respect the market clock (`alpaca-broker-market-data`). - Track fills via the **trade events SSE stream**, not by polling each order — see `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`.
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for alpaca-broker-trading-orders, ready for a manual X post.
alpaca-broker-trading-orders: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty... 142 stars https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=x
Listing + install path for alpaca-broker-trading-orders: https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=x Install: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to alpacahq but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders/audit)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)alpacahq
@alpacahq
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.2K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.4K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.2K StarsAnthropic Brand Guidelines
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
174.2K StarsSandbox only
Install targets
Codex install prompt
Install the "alpaca-broker-trading-orders" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/trading-orders. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest, or portfolio flows on Alpaca in any language. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"alpacahq-alpaca-broker-trading-orders","task":"Install alpaca-broker-trading-orders","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Design assets, images, video, audio, multimodal media, presentation, and creative production skills.
Scenario
Design and creative
I need my agent to produce design assets, UI directions, presentations, or creative media workflows.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Maintenance
fresh
3d since push
Risk
Risky
Permission surface may require sandboxing
GitHub quality
142
68/100 Quality · 75/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Financial research output is not financial advice; require human review before any live investment decision
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
PromisingUseful candidate, but compare it with alternatives before adopting.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
RiskyA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
142 GitHub stars
Repo activity
142 stars, 17 forks
Maintenance
3d since push
License
Apache-2.0
Install
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-ordersDo not use when
Alternative
174.2K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.4K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
174.2K Stars
npx skills add anthropics/skills --skill canvas-design
Alternative
174.2K Stars
npx skills add anthropics/skills --skill brand-guidelines
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
medium
Skill may inspect schemas, query databases, or work with persistent stores.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20alpaca-broker-trading-orders%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20alpaca-broker-trading-orders%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/alpacahq-alpaca-broker-trading-orders/install
Agent should check
Copy prompt
Task: Use alpaca-broker-trading-orders in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20alpaca-broker-trading-orders%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-trading-orders/install
Install command: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/alpacahq-alpaca-broker-trading-orders/install
LLM text format
/api/skills/alpacahq-alpaca-broker-trading-orders/install?format=text
Find alternatives
/api/skills/search?q=alpaca-broker-trading-orders&limit=3
Agent prompt
Use alpaca-broker-trading-orders for this task. Review https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-trading-orders/install, then install with: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-ordersRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/alpacahq-alpaca-broker-trading-orders
LLM text
/api/registry/manifest/alpacahq-alpaca-broker-trading-orders?format=text
Install alias
/api/registry/install/alpacahq-alpaca-broker-trading-orders
Recommend
/api/registry/recommend?task=Use%20alpaca-broker-trading-orders%20in%20an%20agent%20workflow&limit=3
Agent fit
Finance and quant
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Prototype with this skill first; keep a fallback candidate ready.
Role in stack
Fallback candidate
Primary fit
Finance and quant
Trust label
Prototype first
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO142 GitHub stars
Stars/forks activity
CHECK142 stars, 17 forks; issue activity unavailable in current metadata
Recent maintenance
PASS3d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Useful candidate, but compare it with alternatives before adopting.
Workflow fit
Analyze markets
I need my agent to analyze markets, financial data, filings, portfolios, and quant strategies.
Create assets
I need my agent to produce design assets, UI directions, presentations, or creative media workflows.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Workflow fit
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
--- name: alpaca-broker-trading-orders description: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest, or portfolio flows on Alpaca in any language. ---
# Alpaca Broker API — Trading on Behalf of Accounts
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-integration` first. Broker API + HTTP Basic auth. (The standalone Trading API uses `/v2/orders` with no account in the path; everything else here transfers.)
## Reference - Guides: `https://docs.alpaca.markets/docs/orders-at-alpaca`, `https://docs.alpaca.markets/docs/fractional-trading` - API ref: `https://docs.alpaca.markets/reference/postorder` - Live schema: `alpaca-docs` MCP → `get-endpoint` title `"Broker API"` path `/v1/trading/accounts/{account_id}/orders`
## 1. Endpoints
| 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.) |
## 2. Create-order request
Schema-required: `type` and `time_in_force`. Conditionally required: `symbol`, `side`, and exactly one of `qty`/`notional`.
```json // 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. Fractional only for `market`+`day` | | `notional` | decimal **string**, up to 9 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`.
## 3. Fractional / notional rules
- **On by default** for all accounts (live + paper). - Asset must have **`fractionable: true`** (check the Assets API — see `alpaca-broker-market-data`), else `requested asset is not fractionable`. - **TIF must be `day`** for fractional/notional. - **Notional** is limited to `market` and `limit` (day); only `limit` for extended hours. Fractional `qty` additionally allows `stop`/`stop_limit` per the guide. - **No shorting fractional** — all fractional sells are marked long. - Precision: up to **9 decimal places** for both `qty` and `notional`.
## 4. Order status lifecycle
`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-event `event`.** The order object's `status` is the enum above. The **SSE trade-update stream** reports a *richer* `event` enum that adds operational events not present as a status — including `held` (multi-leg secondary legs awaiting trigger), `trade_bust`, `trade_correct`, `restated`, `order_cancel_rejected`, `order_replace_rejected`. So `held` exists as a trade *event* but never as an order *status*. See `alpaca-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).
So the typical opening sequence is `accepted → pending_new → new`, then fills. **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.
## 5. Positions & trading account
**`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`. - Blockers: `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. (Cache it per account within a batch run to avoid re-fetching.)
> **PDT/day-trade fields are deprecated** (since 2026-04-27, sunset 2026-07-06) following FINRA's intraday-margin rule change: `daytrade_count`, `pattern_day_trader`, `daytrading_buying_power`, `bod_dtbp`, plus config `dtbp_check`/`pdt_check`. They still exist in the schema today but stop relying on them.
## 6. Documented gotchas
- **Wash-trade rejection (403):** if a user's two orders could self-cross (opposite sides, crossable prices), Alpaca rejects. Opposing market/stop pairs are always rejected; opposing limits rejected when buy-limit ≥ sell-limit. **Use `bracket`/`oco`/`trailing_stop` for simultaneous take-profit + stop-loss** — they're exempt. - **Bracket constraints:** requires both `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. - **Notional orders can't be replaced** — cancel and resubmit (IPO-class notional is the exception). Fractional `qty` can't be changed on replace ("full shares only"). - **Replace ≠ guaranteed:** a `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`. - **Cancel semantics:** single cancel → `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`.
## 7. Idempotency & recurring-invest lessons
- **Always set `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. - **Recurring/scheduled buys (lesson):** the robust pattern is — fetch pending invest instructions from your DB → check buying power → place a `notional` `market`/`day` order per instruction → record the returned order → mark the instruction done **only after** a successful create. On insufficient funds, cancel the instruction and notify, don't silently skip. Schedule the batch shortly **before** market open and respect the market clock (`alpaca-broker-market-data`). - Track fills via the **trade events SSE stream**, not by polling each order — see `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`.
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for alpaca-broker-trading-orders, ready for a manual X post.
alpaca-broker-trading-orders: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty... 142 stars https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=x
Listing + install path for alpaca-broker-trading-orders: https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=x Install: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to alpacahq but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders/audit)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)alpacahq
@alpacahq
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.2K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.4K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.2K StarsAnthropic Brand Guidelines
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
174.2K StarsSandbox only
Install targets
Codex install prompt
Install the "alpaca-broker-trading-orders" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/trading-orders. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest, or portfolio flows on Alpaca in any language. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"alpacahq-alpaca-broker-trading-orders","task":"Install alpaca-broker-trading-orders","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Design assets, images, video, audio, multimodal media, presentation, and creative production skills.
Scenario
Design and creative
I need my agent to produce design assets, UI directions, presentations, or creative media workflows.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Maintenance
fresh
3d since push
Risk
Risky
Permission surface may require sandboxing
GitHub quality
142
68/100 Quality · 75/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Financial research output is not financial advice; require human review before any live investment decision
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
PromisingUseful candidate, but compare it with alternatives before adopting.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
RiskyA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
142 GitHub stars
Repo activity
142 stars, 17 forks
Maintenance
3d since push
License
Apache-2.0
Install
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-ordersDo not use when
Alternative
174.2K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.4K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
174.2K Stars
npx skills add anthropics/skills --skill canvas-design
Alternative
174.2K Stars
npx skills add anthropics/skills --skill brand-guidelines
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
medium
Skill may inspect schemas, query databases, or work with persistent stores.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20alpaca-broker-trading-orders%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20alpaca-broker-trading-orders%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/alpacahq-alpaca-broker-trading-orders/install
Agent should check
Copy prompt
Task: Use alpaca-broker-trading-orders in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20alpaca-broker-trading-orders%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-trading-orders/install
Install command: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/alpacahq-alpaca-broker-trading-orders/install
LLM text format
/api/skills/alpacahq-alpaca-broker-trading-orders/install?format=text
Find alternatives
/api/skills/search?q=alpaca-broker-trading-orders&limit=3
Agent prompt
Use alpaca-broker-trading-orders for this task. Review https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-trading-orders/install, then install with: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-ordersRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/alpacahq-alpaca-broker-trading-orders
LLM text
/api/registry/manifest/alpacahq-alpaca-broker-trading-orders?format=text
Install alias
/api/registry/install/alpacahq-alpaca-broker-trading-orders
Recommend
/api/registry/recommend?task=Use%20alpaca-broker-trading-orders%20in%20an%20agent%20workflow&limit=3
Agent fit
Finance and quant
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Prototype with this skill first; keep a fallback candidate ready.
Role in stack
Fallback candidate
Primary fit
Finance and quant
Trust label
Prototype first
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO142 GitHub stars
Stars/forks activity
CHECK142 stars, 17 forks; issue activity unavailable in current metadata
Recent maintenance
PASS3d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Useful candidate, but compare it with alternatives before adopting.
Workflow fit
Analyze markets
I need my agent to analyze markets, financial data, filings, portfolios, and quant strategies.
Create assets
I need my agent to produce design assets, UI directions, presentations, or creative media workflows.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Workflow fit
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Find, compare, and synthesize
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
--- name: alpaca-broker-trading-orders description: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty vs notional, fractional shares, order types/TIF/classes), order status lifecycle, replace/cancel, positions, and trading-account buying power. Use when building trading, recurring-invest, or portfolio flows on Alpaca in any language. ---
# Alpaca Broker API — Trading on Behalf of Accounts
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-integration` first. Broker API + HTTP Basic auth. (The standalone Trading API uses `/v2/orders` with no account in the path; everything else here transfers.)
## Reference - Guides: `https://docs.alpaca.markets/docs/orders-at-alpaca`, `https://docs.alpaca.markets/docs/fractional-trading` - API ref: `https://docs.alpaca.markets/reference/postorder` - Live schema: `alpaca-docs` MCP → `get-endpoint` title `"Broker API"` path `/v1/trading/accounts/{account_id}/orders`
## 1. Endpoints
| 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.) |
## 2. Create-order request
Schema-required: `type` and `time_in_force`. Conditionally required: `symbol`, `side`, and exactly one of `qty`/`notional`.
```json // 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. Fractional only for `market`+`day` | | `notional` | decimal **string**, up to 9 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`.
## 3. Fractional / notional rules
- **On by default** for all accounts (live + paper). - Asset must have **`fractionable: true`** (check the Assets API — see `alpaca-broker-market-data`), else `requested asset is not fractionable`. - **TIF must be `day`** for fractional/notional. - **Notional** is limited to `market` and `limit` (day); only `limit` for extended hours. Fractional `qty` additionally allows `stop`/`stop_limit` per the guide. - **No shorting fractional** — all fractional sells are marked long. - Precision: up to **9 decimal places** for both `qty` and `notional`.
## 4. Order status lifecycle
`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-event `event`.** The order object's `status` is the enum above. The **SSE trade-update stream** reports a *richer* `event` enum that adds operational events not present as a status — including `held` (multi-leg secondary legs awaiting trigger), `trade_bust`, `trade_correct`, `restated`, `order_cancel_rejected`, `order_replace_rejected`. So `held` exists as a trade *event* but never as an order *status*. See `alpaca-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).
So the typical opening sequence is `accepted → pending_new → new`, then fills. **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.
## 5. Positions & trading account
**`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`. - Blockers: `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. (Cache it per account within a batch run to avoid re-fetching.)
> **PDT/day-trade fields are deprecated** (since 2026-04-27, sunset 2026-07-06) following FINRA's intraday-margin rule change: `daytrade_count`, `pattern_day_trader`, `daytrading_buying_power`, `bod_dtbp`, plus config `dtbp_check`/`pdt_check`. They still exist in the schema today but stop relying on them.
## 6. Documented gotchas
- **Wash-trade rejection (403):** if a user's two orders could self-cross (opposite sides, crossable prices), Alpaca rejects. Opposing market/stop pairs are always rejected; opposing limits rejected when buy-limit ≥ sell-limit. **Use `bracket`/`oco`/`trailing_stop` for simultaneous take-profit + stop-loss** — they're exempt. - **Bracket constraints:** requires both `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. - **Notional orders can't be replaced** — cancel and resubmit (IPO-class notional is the exception). Fractional `qty` can't be changed on replace ("full shares only"). - **Replace ≠ guaranteed:** a `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`. - **Cancel semantics:** single cancel → `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`.
## 7. Idempotency & recurring-invest lessons
- **Always set `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. - **Recurring/scheduled buys (lesson):** the robust pattern is — fetch pending invest instructions from your DB → check buying power → place a `notional` `market`/`day` order per instruction → record the returned order → mark the instruction done **only after** a successful create. On insufficient funds, cancel the instruction and notify, don't silently skip. Schedule the batch shortly **before** market open and respect the market clock (`alpaca-broker-market-data`). - Track fills via the **trade events SSE stream**, not by polling each order — see `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`.
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for alpaca-broker-trading-orders, ready for a manual X post.
alpaca-broker-trading-orders: Place and manage orders on behalf of accounts via the Alpaca Broker API — order creation (qty... 142 stars https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=x
Listing + install path for alpaca-broker-trading-orders: https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=x Install: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-trading-orders
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to alpacahq but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders/audit)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-trading-orders?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)alpacahq
@alpacahq
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.2K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.4K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.2K StarsAnthropic Brand Guidelines
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
174.2K StarsPermission surface
shell or command execution, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
shell or command execution, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
shell or command execution, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
shell or command execution, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness