Portfolio Construction
Supported Optimizers
Introduction
This page describes the pre-built Portfolio Optimizer models in LEAN. The number of models grows over time. To add a model to LEAN, make a pull request to the GitHub repository. If none of these models perform exactly how you want, create a custom Portfolio Optimizer model.
Maximum Sharpe Ratio Optimizer
The MaximumSharpeRatioPortfolioOptimizer seeks to maximize the portfolio Sharpe Ratio.
var optimizer = new MaximumSharpeRatioPortfolioOptimizer();
optimizer = MaximumSharpeRatioPortfolioOptimizer()
The following table describes the arguments the model accepts:
| Argument | Data Type | Description | Default Value |
|---|---|---|---|
minimum_weightlower | doublefloat | The lower bounds on portfolio weights | -1 |
maximum_weightupper | doublefloat | The upper bounds on portfolio weights | 1 |
risk_free_rateriskFreeRate | doublefloat | The risk free rate | 0 |
For more information about this model, see the class reference and implementation.
For more information about this model, see the class reference and implementation.
Minimum Variance Optimizer
The MinimumVariancePortfolioOptimizer seeks to minimize the portfolio variance and achieve a target return.
var optimizer = new MinimumVariancePortfolioOptimizer();
optimizer = MinimumVariancePortfolioOptimizer()
The following table describes the arguments the model accepts:
| Argument | Data Type | Description | Default Value |
|---|---|---|---|
minimum_weightlower | doublefloat | The lower bounds on portfolio weights | -1 |
maximum_weightupper | doublefloat | The upper bounds on portfolio weights | 1 |
target_returntargetReturn | doublefloat | The target portfolio return | 0.02 (2%) |
For more information about this model, see the class reference and implementation.
For more information about this model, see the class reference and implementation.
Unconstrained Mean Variance Optimizer
The UnconstrainedMeanVariancePortfolioOptimizer seeks to find the optimal risk-adjusted portfolio that lies on the efficient frontier.
var optimizer = new UnconstrainedMeanVariancePortfolioOptimizer();
optimizer = UnconstrainedMeanVariancePortfolioOptimizer()
For more information about this model, see the class reference and implementation.
For more information about this model, see the class reference and implementation.
Risk Parity Optimizer
The RiskParityPortfolioOptimizer seeks to equalize the individual risk contribution to the total portfolio risk from each asset.
var optimizer = new RiskParityPortfolioOptimizer();
optimizer = RiskParityPortfolioOptimizer()
The following table describes the arguments the model accepts:
| Argument | Data Type | Description | Default Value |
|---|---|---|---|
minimum_weightlower | doublefloat | The lower bounds on portfolio weights | 1e-05 |
maximum_weightupper | doublefloat | The upper bounds on portfolio weights | sys.float_info.maxDouble.MaxValue |
For more information about this model, see the class reference and implementation.
For more information about this model, see the class reference and implementation.