DocsActionOpen Position

Open Position

EntryAction

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

ParameterDefaultDescription
positionTypemarket_longOrder type and direction. See the order types table below.
initialCapital10 000Starting capital used for PnL calculations (backtesting only).
quantity1Number of contracts/shares to open. Ignored when usePercentOfEquity is true.
usePercentOfEquityfalseWhen true, quantity is derived from percentOfEquity instead.
percentOfEquity10Percent of current equity to allocate. Active only when usePercentOfEquity is true.
commission0Per-trade commission charged on entry and exit (in account currency).
slippage0Price slippage applied to the fill price on both entry and exit.

Order Types

ValueLabelGroupDescription
market_longMarket LongMarketBuy immediately at the current market price.
market_shortMarket ShortMarketSell short immediately at the current market price.
limit_longLimit LongLimitBuy at a specified price or better.
limit_shortLimit ShortLimitSell short at a specified price or better.
stop_longStop LongStopBuy once price reaches or exceeds the stop price.
stop_shortStop ShortStopSell short once price falls to or below the stop price.
stop_limit_longStop Limit LongStop LimitTriggers a limit buy when the stop price is reached.
stop_limit_shortStop Limit ShortStop LimitTriggers a limit sell when the stop price is reached.

Inputs & Outputs

PortHandleRequiredDescription
Inputs
Priceinput1YesPrice series used to determine the fill price. Typically a close or OHLCV source.
Take Profitinput2RecommendedTake Profit node output. The node will not open if this is missing.
Stop Lossinput3RecommendedStop Loss node output. The node will not open if this is missing.
SignalsignalYesEntry trigger signal. A non-zero value on the last bar opens the position.
Outputs
positionTypeActive order type string (e.g. 'market_long').
entryPriceFill price at which the position was opened.
entryTimestampUnix timestamp of the entry bar.
stopLossPriceFrozen stop loss price at time of entry.
takeProfitPriceFrozen take profit price at time of entry.
positionPriceLast known price from the price input.
timestampsFull timestamp array from the price source.
closePricesArray of close prices from the price source.
readyBoolean — true when both SL and TP are wired and valid.
signalTriggeredBoolean — 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

Single position guard. Open Position will not open a second trade while one is already active. Use Close Position or allow TP/SL to close the current trade first.
Ready flag. The 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.
Price fallback. If input1 is not connected, the node attempts to resolve the price series from the Stop Loss node's upstream price source. Always connecting input1 explicitly is recommended.

Related Nodes