---
id: "P:cAlgo.API.ChartRobot.State"
kind: "property"
type: "T:cAlgo.API.ChartRobot"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/Robots/ChartRobot/State/"
---

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

# ChartRobot.State

Member of [ChartRobot](https://help.ctrader.com/ctrader-algo/references/Chart/Robots/ChartRobot/index.md).

## State

Gets the current state of a Robot instance.

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

- Cloud: Never available in the cloud: it is only returned by members that do not work there (ChartRobots, ChartRobots.Add, ChartRobots.Item and more).

C#:

```csharp
RobotState State {get;}
```

Python:

```python
chartRobot.State: RobotState
```

### Returns

`RobotState` — 

### Examples

C#:

```csharp
foreach (var chartRobot in ChartRobots)
{
    if (chartRobot.State == RobotState.Running)
        Print("{0} is running", chartRobot.Name);
}
```

Python:

```python
for chartRobot in api.ChartRobots:
    if chartRobot.State == RobotState.Running:
        api.Print(f"{chartRobot.Name} is running")
```

