---
title: "Supported Optimizers"
description: "This page describes the pre-built Portfolio Optimizer models in LEAN. If none of these models perform how you want, create a custom Optimizer model."
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms/algorithm-framework/portfolio-construction/supported-optimizers
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms/algorithm-framework/portfolio-construction/supported-optimizers.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms/34%20Algorithm%20Framework/04%20Portfolio%20Construction/03%20Supported%20Optimizers
modified: 2026-10-31
index: https://www.quantconnect.com/llms.txt
---

# Supported Optimizers

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Writing Algorithms](https://www.quantconnect.com/docs/v2/writing-algorithms.md) > Algorithm Framework > Portfolio Construction > Supported Optimizers

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## 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](https://github.com/QuantConnect/Lean/tree/master/Algorithm.Framework/Portfolio). If none of these models perform exactly how you want, create a [custom Portfolio Optimizer model](https://www.quantconnect.com/docs/v2/writing-algorithms/algorithm-framework/portfolio-construction/key-concepts.md#09-Portfolio-Optimizer-Structure).

## Maximum Sharpe Ratio Optimizer

The `MaximumSharpeRatioPortfolioOptimizer` seeks to maximize the portfolio [Sharpe Ratio](https://www.quantconnect.com/docs/v2/writing-algorithms/key-concepts/glossary.md#30-Sharpe-ratio).

```python
optimizer = MaximumSharpeRatioPortfolioOptimizer()
```

The following table describes the arguments the model accepts:

| Argument | Data Type | Description | Default Value |
| --- | --- | --- | --- |
| `minimum_weight` | `float` | The lower bounds on portfolio weights | -1 |
| `maximum_weight` | `float` | The upper bounds on portfolio weights | 1 |
| `risk_free_rate` | `float` | The risk free rate | 0 |

For more information about this model, see the [class reference](https://www.lean.io/docs/v2/lean-engine/class-reference/py/QuantConnect/Algorithm/Framework/Portfolio/MaximumSharpeRatioPortfolioOptimizer/) and [implementation](https://github.com/QuantConnect/Lean/blob/master/Algorithm.Framework/Portfolio/MaximumSharpeRatioPortfolioOptimizer.py).

## Minimum Variance Optimizer

The `MinimumVariancePortfolioOptimizer` seeks to minimize the portfolio variance and achieve a target return.

```python
optimizer = MinimumVariancePortfolioOptimizer()
```

The following table describes the arguments the model accepts:

| Argument | Data Type | Description | Default Value |
| --- | --- | --- | --- |
| `minimum_weight` | `float` | The lower bounds on portfolio weights | -1 |
| `maximum_weight` | `float` | The upper bounds on portfolio weights | 1 |
| `target_return` | `float` | The target portfolio return | 0.02 (2%) |

For more information about this model, see the [class reference](https://www.lean.io/docs/v2/lean-engine/class-reference/py/QuantConnect/Algorithm/Framework/Portfolio/MinimumVariancePortfolioOptimizer/) and [implementation](https://github.com/QuantConnect/Lean/blob/master/Algorithm.Framework/Portfolio/MinimumVariancePortfolioOptimizer.py).

## Unconstrained Mean Variance Optimizer

The `UnconstrainedMeanVariancePortfolioOptimizer` seeks to find the optimal risk-adjusted portfolio that lies on the efficient frontier.

```python
optimizer = UnconstrainedMeanVariancePortfolioOptimizer()
```

For more information about this model, see the [class reference](https://www.lean.io/docs/v2/lean-engine/class-reference/py/QuantConnect/Algorithm/Framework/Portfolio/UnconstrainedMeanVariancePortfolioOptimizer/) and [implementation](https://github.com/QuantConnect/Lean/blob/master/Algorithm.Framework/Portfolio/UnconstrainedMeanVariancePortfolioOptimizer.py).

## Risk Parity Optimizer

The `RiskParityPortfolioOptimizer` seeks to equalize the individual risk contribution to the total portfolio risk from each asset.

```python
optimizer = RiskParityPortfolioOptimizer()
```

The following table describes the arguments the model accepts:

| Argument | Data Type | Description | Default Value |
| --- | --- | --- | --- |
| `minimum_weight` | `float` | The lower bounds on portfolio weights | 1e-05 |
| `maximum_weight` | `float` | The upper bounds on portfolio weights | `sys.float_info.max` |

For more information about this model, see the [class reference](https://www.lean.io/docs/v2/lean-engine/class-reference/py/QuantConnect/Algorithm/Framework/Portfolio/RiskParityPortfolioOptimizer/) and [implementation](https://github.com/QuantConnect/Lean/blob/master/Algorithm.Framework/Portfolio/RiskParityPortfolioOptimizer.py).
