Skip to content

EqualWeight


class backtide.sizers.EqualWeight(n_positions)

Divide current equity equally across a fixed number of positions.

Computes quantity = (equity / n_positions) / price. Useful for portfolio-level rotation strategies where every selected symbol gets the same allocation regardless of price or volatility.

Parameters

n_positions : int

Number of concurrent positions to split the equity across.


See Also

BaseSizer

Abstract base class for all position sizers.

FixedFractional

Allocate a fixed percentage of total current equity.

FixedNotional

Buy a fixed amount of currency worth of the asset.


Methods

calculate Calculate the order quantity for this sizer.


method backtide.sizerscalculate(equity, price, stop_distance=None, atr=None)

Calculate the order quantity for this sizer.

Parameters

equity : float

Current portfolio equity in the same currency as price. When a sizer is attached to an order, the engine passes equity converted to that instrument's quote currency.

price : float
Reference price of the instrument.

stop_distance : float | None, default=None
Distance from entry to stop loss, in price units.

atr : float | None, default=None
Current ATR value. Required for volatility-based sizers.

Returns

int | float

The number of units to trade. Positive for buys, negative for sells.