---
id: "M:cAlgo.API.ParameterAttribute.#ctor(System.String)"
kind: "constructor"
type: "T:cAlgo.API.ParameterAttribute"
url: "https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/Constructor/"
---

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

# ParameterAttribute constructor

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

## ParameterAttribute(string name)

Initializes a new ParameterAttribute instance and sets the name.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public ParameterAttribute(string name)
```

Python:

```python
ParameterAttribute(name: str)
```

### Parameters

- `name` (`string`, Python `str`): The name of the parameter.

### Examples

C#:

```csharp
public partial class ParameterSample : Robot
{
    protected override void OnStart()
    {
        ExecuteMarketOrder(TradeType.Buy, SymbolName, Symbol.QuantityToVolumeInUnits(VolumeInLots), "myLabel");
    }
}
```

Python:

```python
def on_start(self):
    api.ExecuteMarketOrder(TradeType.Buy, api.SymbolName, api.Symbol.QuantityToVolumeInUnits(api.VolumeInLots), "myLabel")
```

config.json:

```json
{
  "AccessRights": "None",
  "Parameters": [
    {
      "Name": "VolumeInLots",
      "DisplayName": "Volume (Lots)",
      "Type": "Double",
      "DefaultValue": 0.01
    }
  ]
}
```

## ParameterAttribute()

Initializes a new instance of the ParameterAttribute class.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public ParameterAttribute()
```

Python:

```python
ParameterAttribute()
```

### Examples

C#:

```csharp
public partial class ParameterSample : Robot
{
    protected override void OnStart()
    {
        Print("MaPeriod: {0}", MaPeriod);
    }
}
```

Python:

```python
def on_start(self):
    api.Print(f"MaPeriod: {api.MaPeriod}")
```

config.json:

```json
{
  "AccessRights": "None",
  "Parameters": [
    {
      "Name": "MaPeriod",
      "Type": "Integer",
      "DefaultValue": 14
    }
  ]
}
```

