DocsActionScale Out

Scale Out

Position SizingAction

Scale Out reduces an open position by a fixed quantity or percentage when triggered. Use it to lock in partial profits at predetermined levels, reduce exposure as momentum slows, or de-risk progressively as the trade extends into potentially thin price territory.

How It Works

  1. 1

    Connect a boolean or numeric signal. The node reads the last non-null value each tick.

  2. 2

    When the value is non-zero and an open position exists, triggered is set to true and a reduce-position order is dispatched.

  3. 3

    When usePercentOfPosition is true, the node closes percentOfPosition % of the current holding (e.g. 50 = close half). Otherwise it reduces by the fixed quantity value.

  4. 4

    Commission and slippage are applied to each partial close independently.

Parameters

ParameterDefaultDescription
orderTypemarketOrder type for the partial close: market, limit, or stop.
usePercentOfPositiontrueWhen true, reduces by percentOfPosition % of the current holding.
percentOfPosition50Percent of the current position to close. Active only when usePercentOfPosition is true.
quantity1Number of contracts/shares to remove. Used when usePercentOfPosition is false.
limitPricenullPrice target for limit and stop orders. Required when orderType is limit or stop.
commission0.1Per-partial-close commission in account currency.
slippage0.05Slippage applied to the partial close fill price.

Inputs & Outputs

PortTypeDescription
Input
inputsignalTrigger signal. Non-zero last value reduces the open position.
Outputs
triggeredbooleantrue when the scale-out order was dispatched on the last tick.
lastSignalValuenumber | nullThe last non-null value read from the input.

Use Cases

Partial profit at 1R

Close 50% of a position when price reaches the 1R target, then let the remainder run with a trailing stop. Locks in profit while keeping upside exposure.

Tiered exit ladder

Chain multiple Scale Out nodes with different percentage thresholds. Fire the first at +1%, the second at +2%, and so on to exit in steps across a rising market.

Momentum fade exit

Wire an RSI divergence or volume drop signal to reduce exposure when momentum shows early signs of exhaustion, without fully exiting the trend.

Tips

Position guard. Scale Out only fires when a position is open. If the position has already been closed by TP/SL, the signal is ignored.
Percentage vs fixed. Percentage mode (usePercentOfPosition) is safer for positions whose size may vary due to Scale In. Fixed quantity mode can accidentally over-reduce if the held size has changed.
Edge-detect the signal. Use a Rising Edge node to fire Scale Out only on the transition from zero to non-zero, preventing repeated partial closes on each bar the condition holds.

Related Nodes