Exchange Order Node
The Exchange Order node executes real trades on your connected exchange account. It supports market, limit, stop, trailing-stop, and bracket orders across multiple exchanges — Alpaca for stocks and crypto, Coinbase for crypto, Hyperliquid and Trade XYZ for perpetuals, OKX for crypto derivatives, and Papernick for paper trading. Every field can be hardcoded or dynamically driven by upstream nodes via the f(x) toggle.
Configuration
Exchange & Account
Order
Configuration
Exchange & Account
| Field | Description |
|---|---|
| Exchange | The exchange to execute on. Changing the exchange resets all fields to safe defaults to prevent unsupported configurations from being silently carried over. |
| Account | API credentials for the selected exchange. The dropdown filters automatically to credentials that match your chosen exchange. |
| Asset Class | Optional. Declares the asset type (crypto, stock, etf, fx, futures, perp). Controls symbol format, shorting context, and which features are available. Shown only when the selected exchange supports multiple asset classes (e.g. Alpaca handles both stocks and crypto). |
| Action | Place Order executes a new order. Close All Positions closes everything open on the account — no other fields are required. |
Order
| Field | Description |
|---|---|
| Symbol | The trading pair — e.g. BTC/USD, ETH/USDT, or AAPL for stocks on Alpaca. Supports the f(x) toggle for dynamic values. When a credential is selected, a live bid/ask ticker appears below the symbol showing real-time prices updated every second. |
| Side | Buy / Long or Sell / Short. For spot assets (crypto, stock, ETF), selling liquidates an existing holding. For derivatives (perp, futures, FX), selling opens a short. A contextual note appears based on the Asset Class selection. |
| Order Type | See Order Types below. Price fields (Limit Price, Stop Price) appear directly under Order Type when relevant. |
| Sizing Mode | Controls how the Amount value is interpreted. See Sizing Modes. |
| Amount | The quantity to trade. The label updates to match Sizing Mode ("Amount (USD)", "Amount (%)", "Risk (USD)"). Supports the f(x) toggle. |
| Max Position Size | Optional. Caps the resolved amount to this value regardless of sizing mode. |
| Skip Zero Amount | When enabled (default), the node returns status: "skipped" if the resolved amount is 0 or invalid instead of failing. |
Order Types
The Order Type field determines how and when your order executes. Price fields appear directly under Order Type when a specific type is selected.
| Type | Description | Extra Fields |
|---|---|---|
| Market | Executes immediately at the best available price. | None |
| Limit | Waits until the price reaches your target. | Limit Price |
| Stop | Triggers a market order when price hits the stop. | Stop Price |
| Stop-Limit | Triggers a limit order when price hits the stop. | Stop Price + Limit Price |
| Trailing Stop | Follows price by a delta percentage; triggers on reversal. | Trailing Delta (%) |
Unsupported order types for the selected exchange are shown greyed out in the dropdown. Check the Supported Exchanges table for per-exchange capabilities.
Price Fields & Bid/Ask Offset Mode
All price fields — Limit Price, Stop Price, and bracket SL/TP — support two entry modes.
Fixed Mode
Enter a specific price. The current bid, ask, and last prices are shown below the field as reference. If only a last price is available (e.g. some crypto feeds), it is shown as "Last: X" instead of bid/ask.
Offset Mode
Click the ≈ offset button to switch to offset mode. Price is expressed as an expression relative to the live market:
bid - 0.1% → 0.1% below the current bid
ask + 100 → $100 above the current ask
bid + 0% → exactly the bid price
The format is (bid|ask)(+|-)(amount)(%?):
- Reference:
bidorask - Operator:
+to add,-to subtract - Amount: a number — absolute dollars, or a percentage if
%is appended
When only a last price is available (no live bid/ask from the exchange), the offset resolves using last and a (last) indicator appears next to the computed result so you know which price was used. Click the ✕ button to return to fixed mode.
Offset values resolve at execution time using the live market price — they are not stored as absolute numbers.
Sizing Modes
Sizing Mode controls how the Amount field is interpreted at runtime.
| Mode | Label | Description |
|---|---|---|
| Raw Amount | Amount | Trade exactly this quantity of the asset (e.g. 0.01 BTC). |
| USD Notional | Amount (USD) | Enter a dollar value. The node fetches the live price and converts to asset quantity automatically. |
| Portfolio % | Amount (%) | Enter a percentage of your total portfolio value (e.g. 5 = 5%). The node fetches your net worth and calculates the quantity. |
| Risk-Based | Risk (USD) | Enter your maximum risk in dollars. Position size = risk ÷ stop-loss distance. Requires a stop order type or a bracket stop-loss to be configured. |
Risk-Based sizing only appears in the dropdown when a stop loss is in scope — either the order type is Stop or Stop-Limit, or Bracket Orders are enabled with a stop-loss value set. It is hidden otherwise to prevent misconfiguration.
Signal-Scaled sizing has been removed. If your workflows used signal_scaled, switch to raw with an upstream Function node that multiplies your signal confidence by the desired max amount.
Bracket Orders (SL/TP)
Enable Bracket Orders (SL/TP) to attach a stop-loss and take-profit to your order simultaneously.
The node uses native bracket support on exchanges that offer it (Alpaca, Coinbase, OKX) and falls back to attached TP/SL orders on others (Hyperliquid, Trade XYZ). Papernick does not support bracket orders.
Bracket Leg Configuration
Each leg (stop-loss and take-profit) has:
| Field | Description |
|---|---|
| Type | market — leg executes as a market order when triggered. limit — leg executes as a limit order; requires Limit Price. |
| Trigger Mode | percentage (default) — value is % from entry price. absolute — value is a fixed price. |
| Value | The stop-loss or take-profit level. In percentage mode: 2 = 2% from fill price. |
| Limit Price | Only for limit type legs. Supports fixed values and bid/ask offset expressions. |
Supported Expressions
Bracket values support:
- Fixed price (e.g.
48000) - Percentage from entry (e.g.
2in percentage mode = 2% SL) - Bid/ask offset expressions (
bid - 2%) - Dynamic f(x) expressions (
{edge.stopLevel})
Bracket orders are automatically disabled when Reduce-Only is active, since reducing a position doesn't support brackets.
Time-in-Force (TIF)
Time-in-Force controls how long an order remains active if not immediately filled.
| TIF | Description |
|---|---|
| GTC | Good Till Cancelled — stays open until filled or manually cancelled. |
| IOC | Immediate or Cancel — fills whatever is available instantly, cancels the rest. |
| FOK | Fill or Kill — must fill completely in one shot, or the entire order is cancelled. |
| DAY | Expires at end of the trading day. |
Unsupported TIF options for the selected exchange are shown greyed out. See the Supported Exchanges table for per-exchange availability.
Advanced Options
Open the Advanced Options section for execution control fields.
| Field | Description |
|---|---|
| Time-in-Force | How long the order stays open. Greyed options are unsupported by the selected exchange. |
| Post-Only | Guarantees maker execution — the order is rejected if it would take liquidity. Supported on Coinbase, Hyperliquid, Trade XYZ, OKX. |
| Reduce-Only | Only reduces an existing position; never increases it. Used to safely close perp/futures positions without accidentally opening a new one. Supported on Hyperliquid, Trade XYZ, OKX. |
| Leverage | Set the leverage multiplier for supported exchanges (Hyperliquid, Trade XYZ, OKX). Enter an integer — e.g. 5 for 5× leverage. |
| Margin Mode | Cross (shared margin pool) or Isolated (per-position margin). Supported on OKX (both) and Trade XYZ (isolated only). |
Fields unsupported by the selected exchange are shown with a tooltip explaining why they are disabled.
TWAP & VWAP Execution
Open the Execution & Metadata section to enable algorithmic execution strategies.
TWAP (Time-Weighted Average Price)
TWAP splits your order into equal slices executed at regular intervals, reducing market impact for large orders.
| Field | Description |
|---|---|
| Enable TWAP | Toggle to activate TWAP mode. |
| Slices | Number of equal sub-orders (2–100). |
| Interval (ms) | Time between slices in milliseconds (1,000–300,000). |
Example: Amount = 1 BTC, Slices = 5, Interval = 60,000 ms → places 0.2 BTC every 60 seconds over 5 minutes.
TWAP is supported on Alpaca, Coinbase, Hyperliquid, Trade XYZ, and OKX. Not available on Papernick.
VWAP (Volume-Weighted Average Price)
Enable VWAP to target the volume-weighted average price over the execution window. VWAP is supported on Alpaca and OKX via their native algo order endpoints.
TWAP and VWAP cannot be enabled simultaneously. VWAP takes precedence if both are set.
Execution & Metadata
| Field | Description |
|---|---|
| Order Tag | A string label attached to the order for audit trail filtering and grouping. Useful for identifying orders from specific workflows or strategies. |
| Order Priority | Sort priority for the Order Sequencer node (lower number = executes first). |
| Description | Human-readable notes about this trade — stored in the audit trail but not sent to the exchange. |
Supported Exchanges
| Exchange | Asset Classes | Order Types | TIF | Brackets | Leverage | TWAP/VWAP |
|---|---|---|---|---|---|---|
| Alpaca | crypto, stock, etf | market, limit, stop, stop_limit, trailing_stop | gtc, ioc, fok, day | Native | Cross | Both |
| Coinbase | crypto | market, limit, stop, stop_limit | gtc, ioc, fok | Native | No | TWAP |
| Hyperliquid | crypto, perp | market, limit, stop, stop_limit | gtc, ioc | Attached | Cross | TWAP |
| Trade XYZ | perp | market, limit, stop, stop_limit | gtc, ioc | Attached | Isolated | TWAP |
| OKX | crypto, futures, perp | market, limit, stop, stop_limit, trailing_stop | gtc, ioc, fok | Native | Cross + Isolated | Both |
| Papernick | crypto, stock, etf | market, limit | gtc, ioc, fok, day | No | No | No |
Native brackets — the exchange handles SL/TP atomically with the entry order.
Attached brackets — NickAI places separate TP/SL orders immediately after the entry fills.
Symbol Normalization
Common symbol variations are normalized automatically:
BTC→BTC/USDBTCUSD→BTC/USDETH→ETH/USD
This works for all major crypto symbols. For stocks on Alpaca, use the standard ticker (e.g. AAPL, TSLA). For OKX perpetuals, use the swap format: BTC-USDT-SWAP. For Hyperliquid and Trade XYZ perps, use the base currency only: BTC, ETH.
Asset Classes & Shorting
Asset Class Field
The Asset Class field declares what type of instrument you are trading. It is optional but affects symbol format, available order types, and contextual notes in the UI.
| Asset Class | Description | Typical Exchanges |
|---|---|---|
crypto | Spot cryptocurrency | Alpaca, Coinbase, OKX, Papernick |
stock | US equity | Alpaca, Papernick |
etf | Exchange-traded fund | Alpaca, Papernick |
perp | Perpetual futures (no expiry) | Hyperliquid, Trade XYZ, OKX |
futures | Dated futures contract | OKX |
fx | Foreign exchange | Future support |
Sell Behavior by Asset Class
| Asset Class | Sell Behavior |
|---|---|
crypto, stock, etf | Sells existing holdings. Shorting requires margin and exchange support — most spot accounts do not allow it. |
perp, futures, fx | Opens a short position. Use Reduce-Only to safely close a short without accidentally opening a new one. |
The properties panel shows a contextual note when you select Sell / Short based on your Asset Class choice.
Workflow Examples
AI-Driven Trading
USD Notional Sizing
Set Sizing Mode to USD Notional to trade a fixed dollar amount instead of a fixed quantity. The node converts automatically using the live price.
Sizing Mode: USD Notional
Amount (USD): 500
At execution, if BTC is at $50,000, the node buys 500 / 50000 = 0.01 BTC.
Limit Order with Bid Offset
Use offset mode to set a limit order 0.1% below the current bid:
Order Type: Limit
Limit Price: bid - 0.1% (offset mode)
This places a passive buy slightly below market without hardcoding a price.
Bracket Order with Percentage SL/TP
Bracket Orders: enabled
Stop-Loss: 2 (2% below entry, percentage mode)
Take-Profit: 5 (5% above entry, percentage mode)
The exchange attaches a stop-loss 2% below fill price and a take-profit 5% above simultaneously. On Hyperliquid and Trade XYZ, these are placed as separate orders immediately after the entry fills.
Risk-Based Position Sizing
Order Type: Stop-Limit
Stop Price: 48,000
Sizing Mode: Risk-Based
Risk (USD): 200
If BTC is at $50,000 and the stop is at $48,000, the stop-loss distance is $2,000. The node sizes the position as 200 / 2000 = 0.1 BTC — risking exactly $200 on the trade.
TWAP for Large Orders
Sizing Mode: USD Notional
Amount (USD): 50,000
Enable TWAP: true
Slices: 10
Interval (ms): 30,000
Places 10 orders of $5,000 each every 30 seconds, spreading $50,000 over 5 minutes to minimize slippage.
Multi-Asset Rebalancing
Each Exchange Order node reads its own edge for side, symbol, and amount — {btc_order.side}, {eth_order.amount} — so one Function node drives multiple trades with different parameters.
Pricing
The Exchange Order node is free — 0 credits per execution. Trades execute on your exchange using your own funds and are subject to your exchange's own fees. NickAI charges nothing on top.
Output
After the order executes, the node outputs a structured result object.
| Path | Description |
|---|---|
| {label.order.id} | Exchange order ID. |
| {label.order.symbol} | Normalized trading symbol (e.g. BTC/USD). |
| {label.order.side} | buy or sell. |
| {label.order.type} | market, limit, etc. |
| {label.order.requestedAmount} | The resolved amount sent to the exchange. |
| {label.order.filledAmount} | The actual filled quantity. |
| {label.order.avgFillPrice} | Average fill price. |
| {label.order.fees} | Fees paid on the trade. |
| {label.order.slippage} | Slippage from expected price. |
| {label.order.executionLatencyMs} | Round-trip latency in milliseconds. |
| {label.order.bracketOrderIds} | SL/TP order IDs when brackets are enabled. |
| {label.order.status} | filled, submitted, skipped, closed_all, etc. |
| {label.skipped} | true if the order was skipped (zero amount with Skip Zero Amount enabled). |
| {label.skipReason} | Why the order was skipped. |
| {label.audit} | Execution audit trail: exchange, action, orderType, sizingMode, resolvedAmount, timestamp. |
label with your actual edge label. If the edge is named trade, use {trade.order.id}, {trade.audit.sizingMode}, etc.Error Handling
| Error | Cause |
|---|---|
| "Symbol is required" | Symbol field is empty or expression resolved to nothing. |
| "Side must be either 'buy' or 'sell'" | Side resolved to an unexpected value. |
| "Amount must be a positive number" | Amount is 0, negative, or NaN after resolution. |
| "Limit price is required…" | Limit order selected but no limit price provided. |
| "Risk-based sizing requires a stop-loss distance" | Risk-based mode needs a stop price to calculate position size. |
| "Credential not found" | Selected credential was deleted or doesn't belong to your account. |
| "Invalid credential type" | Credential type doesn't match the selected exchange. |
Next Steps
- Function Node — Calculate position sizes, convert dollar amounts, prepare dynamic order parameters.
- Conditional Node — Gate trades on signals, thresholds, or risk checks.
- Price Data Node — Fetch live market prices to feed into trading logic.
- Portfolio Node — Check positions and balances before placing orders.