---
id: "M:cAlgo.API.OptimizationIntegerParameter.#ctor(System.String,System.Int32,System.Int32,System.Int32)"
kind: "constructor"
type: "T:cAlgo.API.OptimizationIntegerParameter"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationIntegerParameter/Constructor/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# OptimizationIntegerParameter constructor

Member of [OptimizationIntegerParameter](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationIntegerParameter/index.md).

## OptimizationIntegerParameter(string name, int min, int max, int step)

Optimizes the parameter over the range the minimum to the maximum by the step.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

C#:

```csharp
public OptimizationIntegerParameter(string name, int min, int max, int step)
```

Python:

```python
OptimizationIntegerParameter(name: str, min: int, max: int, step: int)
```

### Parameters

- `name` (`string`, Python `str`): The cBot parameter name.
- `min` (`int`, Python `int`): The inclusive minimum of the range.
- `max` (`int`, Python `int`): The inclusive maximum of the range.
- `step` (`int`, Python `int`): The step of the range.

Available since cAlgo.API 5.9.

### Examples

C#:

```csharp
var parameter = new OptimizationIntegerParameter("SlowPeriods", 20, 100, 10);
Print("{0} is optimized: {1}", parameter.Name, parameter.IsOptimized);
```

Python:

```python
parameter = OptimizationIntegerParameter("SlowPeriods", 20, 100, 10)
api.Print(f"{parameter.Name} is optimized: {parameter.IsOptimized}")
```

## OptimizationIntegerParameter(string name, int value)

Holds the parameter fixed at the given value.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

C#:

```csharp
public OptimizationIntegerParameter(string name, int value)
```

Python:

```python
OptimizationIntegerParameter(name: str, value: int)
```

### Parameters

- `name` (`string`, Python `str`): The cBot parameter name.
- `value` (`int`, Python `int`): The fixed value.

Available since cAlgo.API 5.9.

### Examples

C#:

```csharp
var parameter = new OptimizationIntegerParameter("FastPeriods", 9);
Print("{0} is fixed at {1}", parameter.Name, parameter.Value);
```

Python:

```python
parameter = OptimizationIntegerParameter("FastPeriods", 9)
api.Print(f"{parameter.Name} is fixed at {parameter.Value}")
```

## OptimizationIntegerParameter(OptimizationIntegerParameter original)



Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

C#:

```csharp
public OptimizationIntegerParameter(OptimizationIntegerParameter original)
```

Python:

```python
OptimizationIntegerParameter(original: OptimizationIntegerParameter)
```

### Parameters

- `original` (`OptimizationIntegerParameter`, Python `OptimizationIntegerParameter`):

Available since cAlgo.API 5.9.

