bayesline.api.equity.MaxPositionSizeConstraint

bayesline.api.equity.MaxPositionSizeConstraint#

model MaxPositionSizeConstraint#

Blanket cap on the absolute weight of every position.

The cap is a holding weight per unit of net nav and applies to every asset the problem can hold, long or short. Ill-defined for a book whose net nav is ~0; such a book rejects an enabled cap at solve time. Applies alongside defaults.position_growth_cap; the tighter of the two binds.

Fields#

Field

Type

Required

Default

Constraints

enabled

bool

No

True

kind

Literal[‘max_position_size’]

No

'max_position_size'

max

float

Yes

gt=0

space

Literal[‘total’, ‘active’]

No

'total'

field enabled: bool [Optional]#

Whether this constraint is applied to the optimization problem.

field kind: Literal['max_position_size'] [Optional]#
field max: float [Required]#

Largest allowed absolute weight, per unit of net nav.

Constraints:
  • gt = 0

field space: Literal['total', 'active'] [Optional]#

Whether the cap applies to the portfolio’s holding weights (total) or to its weights in excess of its benchmark’s (active).