sf_quant.optimizer.ZeroInvestment#
- class sf_quant.optimizer.ZeroInvestment(*args, **kwargs)#
Enforces a zero-investment constraint.
This constraint ensures that the sum of all portfolio weights equals 0, representing a market-neutral position.
Returns#
- cp.Constraint
A CVXPY constraint enforcing zero investment.
Examples#
>>> import cvxpy as cp >>> from sf_quant.optimizer.constraints import ZeroInvestment >>> weights = cp.Variable(3) >>> constraint = ZeroInvestment()(weights)
- __init__(*args, **kwargs)#
Methods
__init__(*args, **kwargs)