Broker
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
Connect an Open Position node to input1. The Broker reads the position's data including entry price, direction, quantity, SL, and TP.
- 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
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
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
The node outputs a TradeObject with the current status (idle, open, or closed), PnL, fill prices, and exit reason.
Parameters
| Parameter | Default | Description |
|---|---|---|
| brokerName | paper_trade | The brokerage to route orders to. See the supported brokers table below. |
Supported Brokers
| Value | Label | Group | Notes |
|---|---|---|---|
| paper_trade | Paper Trade | Simulated | Simulates fills using SL/TP levels. No real orders sent. Ideal for backtesting and paper trading. |
| interactive_brokers | Interactive Brokers | Stocks & Options | Routes orders via the IB TWS or Gateway API. |
| td_ameritrade | TD Ameritrade | Stocks & Options | Routes orders via the TD Ameritrade REST API. |
| charles_schwab | Charles Schwab | Stocks & Options | Routes orders via the Charles Schwab API. |
| tradestation | TradeStation | Stocks & Options | Routes orders via the TradeStation API. |
| etrade | E*TRADE | Stocks & Options | Routes orders via the E*TRADE API. |
| robinhood | Robinhood | Stocks & Options | Routes orders via the Robinhood API. |
| webull | Webull | Stocks & Options | Routes orders via the Webull API. |
| tastytrade | Tastytrade | Stocks & Options | Routes orders via the Tastytrade API. |
| alpaca | Alpaca | Stocks & Options | Routes orders via the Alpaca Markets REST API. |
| binance | Binance | Crypto | Routes spot and futures orders via the Binance API. |
| coinbase | Coinbase | Crypto | Routes orders via the Coinbase Advanced Trade API. |
| kraken | Kraken | Crypto | Routes orders via the Kraken REST API. |
| oanda | OANDA | Forex | Routes forex orders via the OANDA v20 REST API. |
| fxcm | FXCM | Forex | Routes forex orders via the FXCM REST API. |
Inputs & Outputs
| Port | Type | Description |
|---|---|---|
| Input | ||
| input1 | PositionObject | Output from an Open Position node. Required — the node errors if not connected. |
| Outputs | ||
| brokerName | string | Active broker identifier (mirrors the parameter). |
| symbol | string | null | Traded symbol, if available. |
| side | 'long' | 'short' | Trade direction derived from positionType. |
| entryPrice | number | Fill price at position open. |
| exitPrice | number | null | Fill price at close. Null while the trade is open. |
| quantity | number | Number of contracts/shares held. |
| stopLossPrice | number | null | Active SL level — updates if Trailing Stop is in use. |
| takeProfitPrice | number | null | Active TP level. |
| pnl | number | null | Realised PnL after close. Null while open. |
| pnlPercent | number | null | Realised PnL as a percent of entry value. |
| entryTimestamp | number | Unix timestamp of the entry bar. |
| exitTimestamp | number | null | Unix timestamp of the exit bar. |
| exitReason | 'takeProfit' | 'stopLoss' | 'signal' | 'manual' | null | Why the trade closed. |
| status | 'idle' | 'open' | 'closed' | Current lifecycle state of the trade. |
| timestamps | number[] | Full timestamp array from the upstream price source. |
| ready | boolean | Always 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.