---
id: "P:cAlgo.API.OptimizationDateOnlyParameter.Max"
kind: "property"
type: "T:cAlgo.API.OptimizationDateOnlyParameter"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationDateOnlyParameter/Max/"
---

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

# OptimizationDateOnlyParameter.Max

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

## Max

Gets the inclusive maximum of the range.

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 DateOnly Max {get;}
```

Python:

```python
optimizationDateOnlyParameter.Max: DateOnly
```

### Returns

`DateOnly` — 

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("Range ends at {0}", parameter.Max);
```

Python:

```python
from System import DateOnly, TimeSpan
parameter = OptimizationDateOnlyParameter("TradingStartDate", DateOnly(2025, 1, 1), DateOnly(2025, 3, 1), TimeSpan.FromDays(7))
api.Print(f"Range ends at {parameter.Max}")
```

