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

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

# OptimizationDateOnlyParameter (record)

A `DateOnly` cBot parameter, optimized over a date 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 OptimizationDateOnlyParameter : OptimizationParameter`1
```

Available since cAlgo.API 5.9.

## Examples

C#:

```csharp
var parameter = new OptimizationDateOnlyParameter("TradingStartDate", new DateOnly(2025, 1, 1), new DateOnly(2025, 3, 1), TimeSpan.FromDays(7));
Print("{0}: {1} to {2} by {3}", parameter.Name, parameter.Min, parameter.Max, parameter.Step);
```

Python:

```python
from System import DateOnly, TimeSpan
parameter = OptimizationDateOnlyParameter("TradingStartDate", DateOnly(2025, 1, 1), DateOnly(2025, 3, 1), TimeSpan.FromDays(7))
api.Print(f"{parameter.Name}: {parameter.Min} to {parameter.Max} by {parameter.Step}")
```

## Constructors

- `public OptimizationDateOnlyParameter(string name, DateOnly min, DateOnly max, TimeSpan 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/OptimizationDateOnlyParameter/Constructor/index.md)
- `public OptimizationDateOnlyParameter(string name, DateOnly value)` — Holds the parameter fixed at the given value. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDateOnlyParameter/Constructor/index.md)
- `public OptimizationDateOnlyParameter(OptimizationDateOnlyParameter original)` —  [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDateOnlyParameter/Constructor/index.md)

## Properties

- `public DateOnly Max {get;}` — Gets the inclusive maximum of the range. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDateOnlyParameter/Max/index.md)
- `public DateOnly Min {get;}` — Gets the inclusive minimum of the range. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDateOnlyParameter/Min/index.md)
- `public TimeSpan Step {get;}` — Gets the step of the range, as a time span. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDateOnlyParameter/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)

