bayesline.api.equity.DoNotTradeConstraint

bayesline.api.equity.DoNotTradeConstraint#

model DoNotTradeConstraint#

Freeze listed assets or whole sides of the book at their current holdings.

Frozen positions keep their current holding exactly; the rest of the book is optimized around them. Assets the problem cannot see (unmapped holdings, holdings outside the risk model universe) are always held fixed and need not be listed.

Fields#

Field

Type

Required

Default

asset_ids

list[str]

No

factory

enabled

bool

No

True

kind

Literal[‘do_not_trade’]

No

'do_not_trade'

scopes

list[Literal[‘all_longs’, ‘all_shorts’]]

No

factory

field asset_ids: list[str] [Optional]#

Assets to freeze, in the risk model’s asset id type.

field enabled: bool [Optional]#

Whether this constraint is applied to the optimization problem.

field kind: Literal['do_not_trade'] [Optional]#
field scopes: list[Literal['all_longs', 'all_shorts']] [Optional]#

Sides of the book to freeze wholesale.