Open Position
Open Position is the primary entry node in a strategy graph. It opens a long or short trade when an upstream signal fires, using a Price source as the entry reference and optional Stop Loss and Take Profit nodes as exit guards. Only one position can be open at a time — the node is a no-op while an active position exists.
Parameters
| Parameter | Default | Description |
|---|---|---|
| positionType | market_long | Order type and direction. See the order types table below. |
| initialCapital | 10 000 | Starting capital used for PnL calculations (backtesting only). |
| quantity | 1 | Number of contracts/shares to open. Ignored when usePercentOfEquity is true. |
| usePercentOfEquity | false | When true, quantity is derived from percentOfEquity instead. |
| percentOfEquity | 10 | Percent of current equity to allocate. Active only when usePercentOfEquity is true. |
| commission | 0 | Per-trade commission charged on entry and exit (in account currency). |
| slippage | 0 | Price slippage applied to the fill price on both entry and exit. |
Order Types
| Value | Label | Group | Description |
|---|---|---|---|
| market_long | Market Long | Market | Buy immediately at the current market price. |
| market_short | Market Short | Market | Sell short immediately at the current market price. |
| limit_long | Limit Long | Limit | Buy at a specified price or better. |
| limit_short | Limit Short | Limit | Sell short at a specified price or better. |
| stop_long | Stop Long | Stop | Buy once price reaches or exceeds the stop price. |
| stop_short | Stop Short | Stop | Sell short once price falls to or below the stop price. |
| stop_limit_long | Stop Limit Long | Stop Limit | Triggers a limit buy when the stop price is reached. |
| stop_limit_short | Stop Limit Short | Stop Limit | Triggers a limit sell when the stop price is reached. |
Inputs & Outputs
| Port | Handle | Required | Description |
|---|---|---|---|
| Inputs | |||
| Price | input1 | Yes | Price series used to determine the fill price. Typically a close or OHLCV source. |
| Take Profit | input2 | Recommended | Take Profit node output. The node will not open if this is missing. |
| Stop Loss | input3 | Recommended | Stop Loss node output. The node will not open if this is missing. |
| Signal | signal | Yes | Entry trigger signal. A non-zero value on the last bar opens the position. |
| Outputs | |||
| positionType | Active order type string (e.g. 'market_long'). | ||
| entryPrice | Fill price at which the position was opened. | ||
| entryTimestamp | Unix timestamp of the entry bar. | ||
| stopLossPrice | Frozen stop loss price at time of entry. | ||
| takeProfitPrice | Frozen take profit price at time of entry. | ||
| positionPrice | Last known price from the price input. | ||
| timestamps | Full timestamp array from the price source. | ||
| closePrices | Array of close prices from the price source. | ||
| ready | Boolean — true when both SL and TP are wired and valid. | ||
| signalTriggered | Boolean — true when the last signal bar is non-zero. | ||
Use Cases
Simple trend-following entry
Wire a Moving Average crossover signal to Open Position with Market Long. Attach a fixed Stop Loss and ATR-based Take Profit to guard the trade.
Breakout stop-entry
Use Stop Long order type so the position only fills if price breaks through a resistance level, avoiding premature entries on false signals.
Equity-scaled sizing
Enable usePercentOfEquity and set percentOfEquity = 2 to risk exactly 2% of current account equity per trade, automatically adjusting as equity grows.
Tips
ready output is only true when both input2 (TP) and input3 (SL) are connected and have resolved prices. If either is missing, the node skips the opening logic on every tick.