Skip to main content

Stock Trading

The Stock Orders API supports placing, modifying, and cancelling orders for US stocks and ETFs. The unified order interface supports standard orders, combo orders (OTO/OCO/OTOCO), take-profit/stop-loss, trailing stops, algorithmic orders, and fractional share trading.

For options trading, see the dedicated Options page. For the full list of supported order types and features by product, see the Feature Matrix in the Trading API Overview.

Order Lifecycle

Every order follows this lifecycle:

  1. Preview — Estimate costs and fees before committing
  2. Place — Submit the order
  3. Replace — Modify price or quantity while the order is open
  4. Cancel — Cancel a pending order
  5. Query — Check order status, history, or details at any time

Key Parameters

ParameterRequiredDescription
account_idYesTrading account identifier
client_order_idYesUnique client-defined order ID (max 32 chars, must be unique per account)
combo_typeYesOrder combination type: NORMAL, MASTER, STOP_PROFIT, STOP_LOSS, OTO, OCO, OTOCO
symbolYesTrading symbol (e.g., AAPL, TSLA)
instrument_typeYesEQUITY for stock orders
marketYesUS
order_typeYesOrder type — see table below
sideYesBUY, SELL, or SHORT
quantityYesNumber of shares. Supports decimals for fractional orders (e.g., "0.5")
total_cash_amountConditionalTotal dollar amount. Required when entrust_type is AMOUNT. Amount must be less than the price of 1 share
entrust_typeYesQTY (by quantity, supports fractional decimals) or AMOUNT (by cash amount, for buying less than 1 share)
time_in_forceYesDAY or GTC
limit_priceConditionalRequired for LIMIT, STOP_LOSS_LIMIT, LIMIT_ON_OPEN
stop_priceConditionalRequired for STOP_LOSS, STOP_LOSS_LIMIT
support_trading_sessionYesCORE, ALL, or NIGHT
trailing_typeConditionalRequired for TRAILING_STOP_LOSS. AMOUNT or PERCENTAGE
trailing_stop_stepConditionalRequired for TRAILING_STOP_LOSS. Trail amount or percentage (e.g., 0.01 = 1%)
client_combo_order_idConditionalRequired when combo_type is not NORMAL

Supported Order Types

Order TypeDescription
MARKETExecute immediately at the best available price
LIMITExecute at the specified price or better
STOP_LOSSTrigger a market order when the stop price is reached
STOP_LOSS_LIMITTrigger a limit order when the stop price is reached
TRAILING_STOP_LOSSStop price trails the market price by a set amount or percentage. Only supports DAY time in force
MARKET_ON_OPENExecute at the opening price (institutional only)
MARKET_ON_CLOSEExecute at the closing price (institutional only)
LIMIT_ON_OPENLimit order at market open (institutional only)

Time in Force

ValueDescription
DAYValid for the current trading day only
GTCGood till cancelled — remains active until filled or manually cancelled (typically up to 60 days)

Trading Sessions

ValueDescription
CORERegular market hours only (9:30 AM – 4:00 PM ET)
ALLExtended hours including pre-market and after-hours
NIGHTNight trading session only

Combo Orders

Combo orders let you link multiple orders together with conditional logic:

Combo TypeDescription
NORMALStandard single order
MASTERPrimary order with attached take-profit and/or stop-loss
STOP_PROFITTake-profit leg attached to a MASTER order
STOP_LOSSStop-loss leg attached to a MASTER order
OTOOne-Triggers-Other — secondary order triggers after primary fills
OCOOne-Cancels-Other — two linked orders, when one fills the other is cancelled
OTOCOOne-Triggers-OCO — primary order triggers two linked OCO orders upon fill
caution

Combo orders require a client_combo_order_id in addition to individual client_order_id for each leg. Each client_order_id must be unique.

Algorithmic Orders

Algorithmic orders execute large orders over time to minimize market impact. Only MARKET and LIMIT order types are supported. Algo orders only run during regular trading hours.

ParameterRequiredDescription
algo_typeYesTWAP, VWAP, or POV
algo_start_timeYesStart time in HH:mm:ss format (US Eastern Time). Must be later than current time
algo_end_timeYesEnd time in HH:mm:ss format (US Eastern Time)
max_target_percentTWAP/VWAPMaximum participation rate (1–20). Defines execution aggressiveness
target_vol_percentPOVTarget volume participation percentage (1–20)
Algo TypeDescription
TWAPTime Weighted Average Price — distributes execution evenly over time
VWAPVolume Weighted Average Price — distributes execution proportional to historical volume
POVPercentage of Volume — participates at a target percentage of real-time market volume

Request Examples

Buy 10 shares of AAPL at a limit price of $180, valid for the current trading day during regular hours.

{
"account_id": "<your_account_id>",
"new_orders": [
{
"client_order_id": "<unique_id>",
"combo_type": "NORMAL",
"symbol": "AAPL",
"instrument_type": "EQUITY",
"market": "US",
"order_type": "LIMIT",
"limit_price": "180.00",
"quantity": "10",
"side": "BUY",
"time_in_force": "DAY",
"support_trading_session": "CORE",
"entrust_type": "QTY"
}
]
}

What's Next