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