Broker

ExecutionAction

The Broker node is the final link in the execution chain. It receives the output of an Open Position node and routes the order to the selected brokerage — or runs a Paper Trade simulation for backtesting. It also monitors the active trade and closes it when the TP or SL price is hit.

How It Works

  1. 1

    Connect an Open Position node to input1. The Broker reads the position's data including entry price, direction, quantity, SL, and TP.

  2. 2

    The node validates that the position's ready flag is true (both SL and TP must be wired). If not, it sets an error and returns null.

  3. 3

    In Paper Trade mode, the node simulates TP and SL fills by comparing the latest price against the frozen SL/TP levels on every tick.

  4. 4

    In live mode, the node forwards the open signal to the selected brokerage API. Exit orders (SL/TP) are placed as conditional orders on the exchange or broker side.

  5. 5

    The node outputs a TradeObject with the current status (idle, open, or closed), PnL, fill prices, and exit reason.

Parameters

ParameterDefaultDescription
brokerNamepaper_tradeThe brokerage to route orders to. See the supported brokers table below.

Supported Brokers

ValueLabelGroupNotes
paper_tradePaper TradeSimulatedSimulates fills using SL/TP levels. No real orders sent. Ideal for backtesting and paper trading.
interactive_brokersInteractive BrokersStocks & OptionsRoutes orders via the IB TWS or Gateway API.
td_ameritradeTD AmeritradeStocks & OptionsRoutes orders via the TD Ameritrade REST API.
charles_schwabCharles SchwabStocks & OptionsRoutes orders via the Charles Schwab API.
tradestationTradeStationStocks & OptionsRoutes orders via the TradeStation API.
etradeE*TRADEStocks & OptionsRoutes orders via the E*TRADE API.
robinhoodRobinhoodStocks & OptionsRoutes orders via the Robinhood API.
webullWebullStocks & OptionsRoutes orders via the Webull API.
tastytradeTastytradeStocks & OptionsRoutes orders via the Tastytrade API.
alpacaAlpacaStocks & OptionsRoutes orders via the Alpaca Markets REST API.
binanceBinanceCryptoRoutes spot and futures orders via the Binance API.
coinbaseCoinbaseCryptoRoutes orders via the Coinbase Advanced Trade API.
krakenKrakenCryptoRoutes orders via the Kraken REST API.
oandaOANDAForexRoutes forex orders via the OANDA v20 REST API.
fxcmFXCMForexRoutes forex orders via the FXCM REST API.

Inputs & Outputs

PortTypeDescription
Input
input1PositionObjectOutput from an Open Position node. Required — the node errors if not connected.
Outputs
brokerNamestringActive broker identifier (mirrors the parameter).
symbolstring | nullTraded symbol, if available.
side'long' | 'short'Trade direction derived from positionType.
entryPricenumberFill price at position open.
exitPricenumber | nullFill price at close. Null while the trade is open.
quantitynumberNumber of contracts/shares held.
stopLossPricenumber | nullActive SL level — updates if Trailing Stop is in use.
takeProfitPricenumber | nullActive TP level.
pnlnumber | nullRealised PnL after close. Null while open.
pnlPercentnumber | nullRealised PnL as a percent of entry value.
entryTimestampnumberUnix timestamp of the entry bar.
exitTimestampnumber | nullUnix timestamp of the exit bar.
exitReason'takeProfit' | 'stopLoss' | 'signal' | 'manual' | nullWhy the trade closed.
status'idle' | 'open' | 'closed'Current lifecycle state of the trade.
timestampsnumber[]Full timestamp array from the upstream price source.
readybooleanAlways true when the node has resolved without error.

Use Cases

Paper trading and backtesting

Set brokerName = paper_trade to simulate SL/TP fills without real orders. The node computes PnL and exit reasons exactly as a live broker would, enabling accurate strategy evaluation.

Live crypto execution via Binance

Set brokerName = binance, connect credentials, and the node submits market orders with OCO (One-Cancels-the-Other) TP/SL pairs on every Open Position signal.

Forex strategy on OANDA

Use brokerName = oanda to send forex orders through the OANDA v20 API. The Broker node maps the position direction and size to OANDA's order schema automatically.

Tips

Always use Paper Trade first. Before switching to a live broker, run your full strategy with paper_trade to confirm SL/TP logic, PnL calculation, and timing are exactly as expected.
Ready flag dependency. The Broker node will return an error and produce no output if the Open Position node's ready flag is false (i.e. SL or TP are not wired). Always ensure both are connected.
One Broker per position. Each Open Position node should have exactly one Broker node downstream. Multiple Broker nodes connected to the same position will submit duplicate orders.

Related Nodes