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

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

# ChartRobotEventArgs (class)

The base class representing event args for a `ChartRobot`.

Environments: Desktop supported · CLI supported · Cloud not supported.

- Cloud: Never raised in the cloud: the ChartRobots events never fire there.

## Definition

```csharp
public abstract class ChartRobotEventArgs
```

## Examples

C#:

```csharp
protected override void OnStart()
{
    Chart.Robots.RobotAdded += OnChartRobotEvent;
    Chart.Robots.RobotRemoved += OnChartRobotEvent;
    Chart.Robots.RobotModified += OnChartRobotEvent;
    Chart.Robots.RobotStarted += OnChartRobotEvent;
    Chart.Robots.RobotStopped += OnChartRobotEvent;
}

private void OnChartRobotEvent(ChartRobotEventArgs args)
{
    Print("{0}: {1} is {2}", args.GetType().Name, args.Robot.Name, args.Robot.State);
}
```

Python:

```python
def on_start(self):
    api.Chart.Robots.RobotAdded += self.on_chart_robot_event
    api.Chart.Robots.RobotRemoved += self.on_chart_robot_event
    api.Chart.Robots.RobotModified += self.on_chart_robot_event
    api.Chart.Robots.RobotStarted += self.on_chart_robot_event
    api.Chart.Robots.RobotStopped += self.on_chart_robot_event

def on_chart_robot_event(self, args):
    api.Print(f"{type(args).__name__}: {args.Robot.Name} is {args.Robot.State}")
```

## Properties

- `public ChartRobot Robot {get;}` — Gets the ChartRobot that raised an event. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartRobotEventArgs/Robot/index.md)

