---
title: "Getting Started"
description: "Parameter optimization is the process of finding the optimal parameters to maximize or minimize an objective function. Just be wary of overfitting."
canonical: https://www.quantconnect.com/docs/v2/local-platform/optimization/getting-started
markdown: https://www.quantconnect.com/docs/v2/local-platform/optimization/getting-started.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/02%20Local%20Platform/12%20Optimization/01%20Getting%20Started
modified: 2026-10-29
index: https://www.quantconnect.com/llms.txt
---

# Getting Started

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Local Platform](https://www.quantconnect.com/docs/v2/local-platform.md) > Optimization > Getting Started

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

## Introduction

Parameter optimization is the process of finding the optimal algorithm parameters to maximize or minimize an objective function. For instance, you can optimize your indicator parameters to maximize the [Sharpe ratio](https://www.quantconnect.com/docs/v2/writing-algorithms/key-concepts/glossary.md#30-Sharpe-ratio) that your algorithm achieves over a backtest. Optimization can help you adjust your strategy to achieve better backtesting performance, but be wary of overfitting. If you select parameter values that model the past too closely, your algorithm may not be robust enough to perform well using out-of-sample data.

## Launch Optimization Jobs

Local Platform provides multiple [deployment targets](https://www.quantconnect.com/docs/v2/local-platform/key-concepts/deployment-targets.md) to enable you to run backtests on-premises and in QuantConnect Cloud.

You need the following to optimize parameters:

- At least one [algorithm parameter in your project](https://www.quantconnect.com/docs/v2/writing-algorithms/optimization/parameters.md#02-Set-Parameters).
- The [GetParameter](https://www.quantconnect.com/docs/v2/writing-algorithms/optimization/parameters.md#03-Get-Parameters) method in your project.
- A successful backtest of the project.

Follow these steps to optimize parameters:

1. [Open the project](https://www.quantconnect.com/docs/v2/local-platform/projects/getting-started.md#04-Open-Projects) that contains the parameters you want to optimize.
2. In the top-right corner of the IDE, click the ![Local optimization icon](https://cdn.quantconnect.com/i/tu/local-platform-optimize-icon.png) / ![Cloud optimization icon](https://cdn.quantconnect.com/i/tu/optimize-parameters-icon.png) **Optimize** icon.
3. On the Optimization page, in the **Parameter & Constraints** section, enter the name of the parameter to optimize.
   The parameter name must match a parameter name in the Project panel.
4. Enter the minimum and maximum parameter values.
5. Click the **gear** icon next to the parameter and then enter a step size.
6. If you want to add another parameter to optimize, click **Add Parameter**.
   You can optimize a maximum of three parameters. To optimize more parameters, [run local optimizations with the CLI](https://www.quantconnect.com/docs/v2/lean-cli/optimization/deployment.md#02-Run-Local-Optimizations).
7. If you want to add [optimization constraints](https://www.quantconnect.com/docs/v2/cloud-platform/optimization/objectives.md#06-Constraints), follow these steps:
   1. Click **Add Constraint**.
   2. Click the **target** field and then select a [target](https://www.quantconnect.com/docs/v2/cloud-platform/optimization/objectives.md) from the drop-down menu.
   3. Click the **operation** field and then an operation from the drop-down menu.
   4. Enter a constraint value.
8. If you are deploying to QuantConnect Cloud, in the **Estimated Number and Cost of Backtests** section, click an [optimization node](https://www.quantconnect.com/docs/v2/cloud-platform/optimization/deployment.md#02-Resources) and then select a maximum number of nodes to use.
9. In the **Strategy & Target** section, click the **Choose Optimization Strategy** field and then select a [strategy](https://www.quantconnect.com/docs/v2/cloud-platform/optimization/strategies.md) from the drop-down menu.
10. Click the **Select Target** field and then select a target from the drop-down menu.
   The target (also known as objective) is the performance metric the optimizer uses to compare the backtest performance of different parameter values.
11. Click **Maximize** or **Minimize** to maximize or minimize the optimization target, respectively.
12. Click **Launch Optimization**.
   The optimization results page displays. If you deploy a local optimization job, you can close Local Platform and Docker Desktop as the optimization job runs without interfering with the backtests. Just don't quit Docker Desktop. If you deploy the optimization job to QuantConnect Cloud, you can close Local Platform and Docker Desktop without interrupting with the backtests because the nodes are processing on our servers.
   To abort a running optimization job, in the Status panel, click **Abort** and then click **Yes**.

## View Individual Backtest Results

The optimization results page displays a Backtests table that includes all of the backtests that ran during the optimization job. The table lists the parameter values of the backtests in the optimization job and their resulting values for the objectives.

![Individual backtest result result](https://cdn.quantconnect.com/i/tu/optimization-results-table-202306.png)

### Open the Backtest Results Page

To open the [backtest result page](https://www.quantconnect.com/docs/v2/local-platform/backtesting/results.md) of one of the backtests in the optimization job, click a backtest in the table.

### Download the Table

To download the table, right-click one of the rows, and then click **Export > CSV Export**.

### Filter the Table

Follow these steps to apply filters to the Backtests table:

1. On the right edge of the Backtests table, click **Filters**.
2. Click the name of the column to which you want the filter to be applied.
3. If the column you selected is numerical, click the **operation** field and then select one of the operations from the drop-down menu.
4. Fill the fields below the operation you selected.
   ![Optimization results table](https://cdn.quantconnect.com/i/tu/filter-optimization-results-table-202306.gif)

### Toggle Table Columns

Follow these steps to hide and show columns in the Backtests table:

1. On the right edge of the Backtests table, click **Columns**.
2. Select the columns you want to include in the Backtests table and deselect the columns you want to exclude.

### Sort the Table Columns

In the Backtests table, click one of the column names to sort the table by that column.

## View All Optimizations

Follow these steps to view all of the optimization results of a project:

1. [Open the project](https://www.quantconnect.com/docs/v2/local-platform/projects/getting-started.md#04-Open-Projects) that contains the optimization results you want to view.
2. At the top of the IDE, click the ![](https://cdn.quantconnect.com/i/tu/local-platform-backtest-results-icon.png) / ![](https://cdn.quantconnect.com/i/tu/cloud-platform-backtest-results-icon.png) **Results** icon.
   A table containing all of the backtest and optimization results for the project is displayed. If there is a **play** icon to the left of the name, it's a [backtest result](https://www.quantconnect.com/docs/v2/local-platform/backtesting/results.md). If there is a **fast-forward** icon next to the name, it's an optimization results.
   ![All backtest table view](https://cdn.quantconnect.com/i/tu/local-platform-view-all-backtests.png)
3. (Optional) In the top-right corner, select the **Show** field and then select one of the options from the drop-down menu to filter the table by backtest or optimization results.
4. (Optional) In the bottom-right corner, click the **Hide Error** check box to remove backtest and optimization results from the table that had a runtime error.
5. (Optional) Use the pagination tools at the bottom to change the page.
6. (Optional) Click a column name to sort the table by that column.
7. Click a row in the table to open the results page of that backtest or optimization.

### Rename Optimizations

We give an arbitrary name (for example, "Smooth Apricot Chicken") to your optimization result files, but you can follow these steps to rename them:

1. Hover over the optimization you want to rename and then click the **pencil** icon that appears.
   ![Rename optimization instance](https://cdn.quantconnect.com/i/tu/rename-optimization-result.png)
2. Enter the new name and then press **Enter**.

### Delete Optimizations

Hover over the optimization you want to delete and then click the **trash can** icon that appears to delete the optimization result.

![Delete optimization result](https://cdn.quantconnect.com/i/tu/delete-optimization-result.png)

## Result Files

To view the results files of a local optimization job, open the `<organizationWorkspace> / <projectName> / optimizations / <optimizationName>` directory. The following table describes the initial contents of the optimization result directories:

| File/Directory | Description |
| --- | --- |
| `code /` | A directory containing a copy of the files that were in the project when you ran the optimization. |
| `<backtestId> /` Ex: `1c5b8eff-89c0-432f-98c7-60b73265b188 /` | A directory containing the [backtest result files](https://www.quantconnect.com/docs/v2/local-platform/backtesting/results.md#15-View-Result-Files) for one of the backtest in the optimization job. There is separate directory for each backtest in the optimization job. |
| `log.txt` | A file containing the syslog. |
| `config` | A file containing some configuration settings, including the optimization Id, Docker container name, and optimization name. |
| `optimizer-config.json` | A file containing some configuration settings, including the parameters, strategy, and constrains. |
| `optimization-result-<optimizationId>.json` Ex: `optimization-result-2455523408.json` | A file containing additional results, including runtime statistics. |

## Algorithm Lab Optimizations

For information about cloud optimizations through the Algorithm Lab, see [Getting Started](https://www.quantconnect.com/docs/v2/cloud-platform/optimization/getting-started.md).

## Get Optimization Id

To get the optimization Id, [open the optimization result page](https://www.quantconnect.com/docs/v2/local-platform/optimization/getting-started.md#04-View-All-Optimizations) and then scroll down to the table that shows the [individual backtest results](https://www.quantconnect.com/docs/v2/local-platform/optimization/getting-started.md#03-View-Individual-Backtest-Results). The optimization Id is at the top of the table. An example local optimization Id is 2726379566. An example cloud optimization Id is O-696d861d6dbbed45a8442659bd24e59f.
