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

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

# RobotAttribute (class)

Sealed class RobotAttribute.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public sealed class RobotAttribute : Attribute
```

## Remarks

Marks a class as a Robot. The Robot attribute cannot be ommited.

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo.Robots
{
    // config.json declares the cBot settings, the class holds only the code
    public partial class RobotAttributeSample : Robot
    {
        protected override void OnStart()
        {
            Print("cBot started on {0}, time zone {1}", SymbolName, TimeZone.DisplayName);
        }
    }
}
```

Python:

```python
class RobotAttributeSample():
    def on_start(self):
        api.Print(f"cBot started on {api.SymbolName}, time zone {api.TimeZone.DisplayName}")
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC"
}
```

## Constructors

- `public RobotAttribute()` — Initializes a new RobotAttribute instance. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/RobotAttribute/Constructor/index.md)

## Properties

- `public AccessRights AccessRights {get; set;}` — Gets or sets the access rights required for the cBot. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/RobotAttribute/AccessRights/index.md)
- `public bool AddIndicators {get; set;}` — Gets or sets whether indicators created by robot will be added to chart or not. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/RobotAttribute/AddIndicators/index.md)
- `public string AdditionalInfoUrl {get; set;}` — Gets or sets additional info url. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/RobotAttribute/AdditionalInfoUrl/index.md)
- `public string DefaultSymbolName {get; set;}` — Not used. cTrader applies no default symbol to a cBot: a new instance runs on the symbol it is added with, which the cBot reads from SymbolName. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/RobotAttribute/DefaultSymbolName/index.md)
- `public string DefaultTimeFrame {get; set;}` — Not used. cTrader applies no default time frame to a cBot: a new instance runs on the time frame of the chart it is added to, which the cBot reads from TimeFrame. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/RobotAttribute/DefaultTimeFrame/index.md)
- `public string Name {get;}` — The name of a robot. Sets from constructor. [details](https://help.ctrader.com/ctrader-algo/references/Attributes/RobotAttribute/Name/index.md)
- `public string TimeZone {get; set;}` — Sets the timezone for all the robot or indicator datetime references [details](https://help.ctrader.com/ctrader-algo/references/Attributes/RobotAttribute/TimeZone/index.md)

## Deprecated members

- `public RobotAttribute(string name)` — Deprecated.

