---
id: "T:cAlgo.API.ParameterAttribute"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/"
---

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

# ParameterAttribute (class)

The Parameter Attribute class.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public class ParameterAttribute : Attribute
```

## Remarks

Marks a property as input parameter.

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This sample indicator shows how to define different types of parameters for your indicators
    public partial class ParameterAttributeSample : Indicator
    {
        protected override void Initialize()
        {
            Print("Periods: {0}, Multiplier: {1}, Label: {2}, Direction: {3}", Periods, Multiplier, Label, Direction);
        }

        public override void Calculate(int index)
        {
        }
    }
}
```

Python:

```python
class ParameterAttributeSample():
    def initialize(self):
        api.Print(f"Periods: {api.Periods}, Multiplier: {api.Multiplier}, Label: {api.Label}, Direction: {api.Direction}")
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true,
  "Parameters": [
    {
      "Name": "Periods",
      "Type": "Integer",
      "DefaultValue": 14,
      "MinValue": 2,
      "MaxValue": 100,
      "Step": 1,
      "Group": "Numeric Group"
    },
    {
      "Name": "Multiplier",
      "Type": "Double",
      "DefaultValue": 1.5,
      "MinValue": 0.1,
      "MaxValue": 10,
      "Step": 0.1,
      "Group": "Numeric Group"
    },
    {
      "Name": "Label",
      "Type": "String",
      "DefaultValue": "myLabel",
      "Group": "String Group"
    },
    {
      "Name": "Direction",
      "Type": "Enum",
      "EnumTypeFullName": "cAlgo.API.TradeType",
      "DefaultValue": "Buy",
      "Group": "Enum Group"
    }
  ]
}
```

## Constructors

- `public ParameterAttribute(string name)` — Initializes a new ParameterAttribute instance and sets the name. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/Constructor/index.md)
- `public ParameterAttribute()` — Initializes a new instance of the ParameterAttribute class. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/Constructor/index.md)

## Properties

- `public object DefaultValue {get; set;}` — Gets or sets the default value of this Parameter property. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/DefaultValue/index.md)
- `public string Description {get; set;}` — Gets or sets description for input parameter that will be shown in UI. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/Description/index.md)
- `public string Group {get; set;}` — Groups parameters in UI. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/Group/index.md)
- `public bool IsValueVisibleInTitle {get; set;}` — Gets or sets whether parameter value should be visible or not in instance title (default: true). [details](https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/IsValueVisibleInTitle/index.md)
- `public object MaxValue {get; set;}` — Gets or sets the maximum value of this Parameter property. It is used for validating user input. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/MaxValue/index.md)
- `public object MinValue {get; set;}` — Gets or sets the minimum value of this Parameter property. It is used for validating user input. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/MinValue/index.md)
- `public string Name {get;}` — The input parameter name. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/Name/index.md)
- `public double Step {get; set;}` — Gets or sets the step of this Parameter. Step is used in NumericUpDown controls in parameter editors. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/ParameterAttribute/Step/index.md)

