Execution:
venue.trade() in chat code, strategy.execute() in strategy agents.Overview
Alpaca connects to Scalar Field via OAuth and provides two accounts:ALPACA_PAPER (simulated money) and ALPACA_LIVE (real money). Both support US equities, ETFs, and options, with identical call semantics — strategy code validated on paper runs unchanged against live.
Order Semantics
- Equity symbols are plain tickers (
AAPL); options use OPRA/OSI symbols (AAPL260919C00250000). Option positions carrymultiplier: 100, somarket_value = qty * price * 100. - Fills are asynchronous.
venue.trade()may return"PENDING"— the order is submitted but not yet filled. Orders usedaytime-in-force; orders placed outside market hours remainPENDINGuntil the next open. Pending orders are reconciled automatically (see Reconciliation). - Fractional quantities are supported for equities. Size from a dollar budget with
round(budget / price, 2). - The
slippage_bpsparameter does not apply to Alpaca.
Connecting
Click “Connect” on the portfolio page and authorize with your Alpaca account. Paper and live accounts link through the same OAuth flow.Usage
strategy.execute(symbol, target_qty) instead — see Strategies.
Data Functions
Equity and options research uses the cross-asset market-data functions; each links to its full reference:Notes
- Positions and cash update only on terminal order states (filled, cancelled, expired); partial fills on a live order are not reflected until the order is terminal.
- A
PENDINGresponse outside market hours is normal — the order executes at the next open. - Avoid trading directly on the Alpaca dashboard while strategies are active on the account — see Reconciliation.
Related
- Strategies — automated strategy execution
- Reconciliation — pending order tracking and position sync
- Supported Venues — venue registry and
venue.*functions