---
id: "P:cAlgo.API.ParameterAttribute.MaxValue"
kind: "property"
type: "T:cAlgo.API.ParameterAttribute"
url: "https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/MaxValue/"
---

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

# ParameterAttribute.MaxValue

Member of [ParameterAttribute](https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/index.md).

## MaxValue

Gets or sets the maximum value of this Parameter property. It is used for validating user input.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public object MaxValue {get; set;}
```

Python:

```python
parameterAttribute.MaxValue: object
```

### Returns

`object` — 

### Examples

C#:

```csharp
public partial class ParameterSample : Robot
{
    protected override void OnStart()
    {
        Print("Risk amount: {0}", Account.Balance * RiskPercent / 100);
    }
}
```

Python:

```python
def on_start(self):
    api.Print(f"Risk amount: {api.Account.Balance * api.RiskPercent / 100}")
```

config.json:

```json
{
  "AccessRights": "None",
  "Parameters": [
    {
      "Name": "RiskPercent",
      "DisplayName": "Risk %",
      "Type": "Double",
      "DefaultValue": 1,
      "MinValue": 0.1,
      "MaxValue": 5
    }
  ]
}
```

