---
id: "T:cAlgo.API.OptimizationDoubleParameter"
kind: "record"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDoubleParameter/"
---

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

# OptimizationDoubleParameter (record)

A `double` cBot parameter, optimized over a numeric range or held fixed.

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.

## Definition

```csharp
public class OptimizationDoubleParameter : OptimizationParameter`1
```

Available since cAlgo.API 5.9.

## Examples

C#:

```csharp
var takeProfit = new OptimizationDoubleParameter("TakeProfitPips", 10, 50, 5);
var stopLoss = new OptimizationDoubleParameter("StopLossPips", 20);
Print("{0}: {1} to {2} by {3}, {4} fixed at {5}", takeProfit.Name, takeProfit.Min, takeProfit.Max, takeProfit.Step, stopLoss.Name, stopLoss.Value);
```

Python:

```python
takeProfit = OptimizationDoubleParameter("TakeProfitPips", 10.0, 50.0, 5.0)
stopLoss = OptimizationDoubleParameter("StopLossPips", 20.0)
api.Print(f"{takeProfit.Name}: {takeProfit.Min} to {takeProfit.Max} by {takeProfit.Step}, {stopLoss.Name} fixed at {stopLoss.Value}")
```

## Constructors

- `public OptimizationDoubleParameter(string name, double min, double max, double step)` — Optimizes the parameter over the range the minimum to the maximum by the step. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDoubleParameter/Constructor/index.md)
- `public OptimizationDoubleParameter(string name, double value)` — Holds the parameter fixed at the given value. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDoubleParameter/Constructor/index.md)
- `public OptimizationDoubleParameter(OptimizationDoubleParameter original)` —  [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDoubleParameter/Constructor/index.md)

## Properties

- `public double Max {get;}` — Gets the inclusive maximum of the range. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDoubleParameter/Max/index.md)
- `public double Min {get;}` — Gets the inclusive minimum of the range. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDoubleParameter/Min/index.md)
- `public double Step {get;}` — Gets the step of the range. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDoubleParameter/Step/index.md)

## Inherited members

- `public string Name {get;}` (from OptimizationParameter) [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationParameter/Name/index.md)
- `public bool IsOptimized {get;}` (from OptimizationParameter) [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationParameter/IsOptimized/index.md)

