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

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

# OptimizationDoubleParameter constructor

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

## OptimizationDoubleParameter(string name, double min, double max, double 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 OptimizationDoubleParameter(string name, double min, double max, double step)
```

Python:

```python
OptimizationDoubleParameter(name: str, min: float, max: float, step: float)
```

### Parameters

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

Available since cAlgo.API 5.9.

### Examples

C#:

```csharp
var parameter = new OptimizationDoubleParameter("TakeProfitPips", 10, 50, 5);
Print("{0} is optimized: {1}", parameter.Name, parameter.IsOptimized);
```

Python:

```python
parameter = OptimizationDoubleParameter("TakeProfitPips", 10.0, 50.0, 5.0)
api.Print(f"{parameter.Name} is optimized: {parameter.IsOptimized}")
```

## OptimizationDoubleParameter(string name, double 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 OptimizationDoubleParameter(string name, double value)
```

Python:

```python
OptimizationDoubleParameter(name: str, value: float)
```

### Parameters

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

Available since cAlgo.API 5.9.

### Examples

C#:

```csharp
var parameter = new OptimizationDoubleParameter("StopLossPips", 20);
Print("{0} is fixed at {1}", parameter.Name, parameter.Value);
```

Python:

```python
parameter = OptimizationDoubleParameter("StopLossPips", 20.0)
api.Print(f"{parameter.Name} is fixed at {parameter.Value}")
```

## OptimizationDoubleParameter(OptimizationDoubleParameter 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 OptimizationDoubleParameter(OptimizationDoubleParameter original)
```

Python:

```python
OptimizationDoubleParameter(original: OptimizationDoubleParameter)
```

### Parameters

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

Available since cAlgo.API 5.9.

