sf_quant.optimizer.LongOnly#

class sf_quant.optimizer.LongOnly#

Enforces a long-only constraint.

This constraint ensures that all portfolio weights are non-negative.

Examples#

>>> weights = cp.Variable(3)
>>> constraint = LongOnly()(weights)
__init__()#

Methods