DocsActionScale In

Scale In

Position SizingAction

Scale In adds contracts or equity percentage to an existing open position when triggered by an upstream signal. Use it to pyramid into a trend as confirmation grows, or to average into a mean-reversion setup on successive pullbacks.

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 an add-to-position order is dispatched.

  3. 3

    The order type (market, limit, stop) determines the fill mechanics. Limit and stop orders require the limitPrice parameter to be set.

  4. 4

    Commission and slippage are applied independently of the original Open Position node settings.

Parameters

ParameterDefaultDescription
orderTypemarketOrder type for the additional fill: market, limit, or stop.
quantity1Number of contracts/shares to add. Ignored when usePercentOfEquity is true.
usePercentOfEquityfalseWhen true, the added quantity is derived from percentOfEquity.
percentOfEquity10Percent of current equity to add to the position. Active only when usePercentOfEquity is true.
limitPricenullPrice target for limit and stop orders. Required when orderType is limit or stop.
commission0.1Per-add commission in account currency.
slippage0.05Slippage applied to the add-to-position fill price.

Inputs & Outputs

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

Use Cases

Trend pyramiding

Add 1 contract each time a new 20-day high is made. Wire a Highest-Value comparison node as the signal, increasing exposure only as the trend strengthens.

Pullback averaging

On a long position, add when RSI dips below 40 — averaging down into a mean-reversion setup while keeping the original stop in place.

Equity-proportional scaling

Enable usePercentOfEquity = true and percentOfEquity = 5 to add a consistent 5% risk slice each time the signal fires, regardless of absolute position size.

Tips

Position guard. Scale In checks for an active position before firing. If no position is open, the signal is silently ignored.
Limit price required. When orderType is limit or stop, you must set limitPrice to a valid number. The node will error if it is null.
Edge-detect the signal. Add a Rising Edge node between your signal source and Scale In to ensure the add only fires once per condition occurrence, not every bar while the condition holds.

Related Nodes