Skip to content

IPortfolioOptimizer

QuantConnect.Algorithm.Framework.Portfolio.IPortfolioOptimizer

Interface for portfolio optimization algorithms

optimize

optimize(
    historical_returns: List[float],
    expected_returns: List[float] = None,
    covariance: List[float] = None,
) -> List[float]

Perform portfolio optimization for a provided matrix of historical returns and an array of expected returns

Parameters:

Name Type Description Default
historical_returns List[float]

Matrix of annualized historical returns where each column represents a security and each row returns for the given date/time (size: K x N).

required
expected_returns List[float]

Array of double with the portfolio annualized expected returns (size: K x 1).

None
covariance List[float]

Multi-dimensional array of double with the portfolio covariance of annualized returns (size: K x K).

None

Returns:

Type Description
List[float]

Array of double with the portfolio weights (size: K x 1).