---
title: "Parameters"
description: "Learn how to configure an optimization to fine tone parameters in your algorithm via Lean CLI."
canonical: https://www.quantconnect.com/docs/v2/lean-cli/optimization/parameters
markdown: https://www.quantconnect.com/docs/v2/lean-cli/optimization/parameters.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/05%20Lean%20CLI/11%20Optimization/01%20Parameters
modified: 2026-10-29
index: https://www.quantconnect.com/llms.txt
---

# Parameters

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Lean CLI](https://www.quantconnect.com/docs/v2/lean-cli.md) > Optimization > Parameters

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

## Introduction

Project parameters are parameters that are defined in your project's [configuration file](https://www.quantconnect.com/docs/v2/lean-cli/projects/configuration.md). These parameters are a replacement for constants in your algorithm and can be optimized using one of LEAN's optimization strategies either locally or in the cloud.

To use the CLI, you must be a member in an [organization](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/tier-features.md) on a paid tier.

## Configure Project Parameters

Follow these steps to make your algorithm use project parameters instead of constant values:

1. Open your project in your preferred editor.
2. Open the project's `config.json` file.
3. Add the required parameters in the `parameters` property. All keys and values of this object must be strings. Example:

   ```
   {
       "parameters": {
           "ema-fast": "10",
           "ema-medium": "30",
           "ema-slow": "50"
       }
   }
   ```
4. Open your algorithm in the editor.
5. Call `QCAlgorithm.GetParameter(name)` in your algorithm to retrieve the value of a parameter and use that instead of constant values.

   ```python
   class ParameterizedAlgorithm(QCAlgorithm):
       def initialize(self) -> None:
           self.set_start_date(2020, 1, 1)
           self.set_cash(100000)
           self.add_equity("SPY")

           fast_period = self.get_parameter("ema-fast", 10)
           medium_period = self.get_parameter("ema-medium", 30)
           slow_period = self.get_parameter("ema-slow", 50)

           self._fast = self.ema("SPY", fast_period)
           self._medium = self.ema("SPY", medium_period)
           self._slow = self.ema("SPY", slow_period)
   ```
