---
id: "T:cAlgo.API.RunningMode"
kind: "enum"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Application/RunningMode/"
---

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

# RunningMode (enum)

Defines if a cBot is running in real time, in the silent backtesting mode, in the visual backtesting mode, or in the optimization mode.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public enum RunningMode
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo.Robots
{
    // This sample shows how to use the RunningMode property of your robot
    public partial class RunningModeSample : Robot
    {
        protected override void OnStart()
        {
            switch (RunningMode)
            {
                case RunningMode.RealTime:
                    Print("Trading on live market data");
                    break;

                case RunningMode.SilentBacktesting:
                    Print("Backtesting with the visual mode off");
                    break;

                case RunningMode.VisualBacktesting:
                    Print("Backtesting with the visual mode on");
                    break;

                case RunningMode.Optimization:
                    Print("Running in the optimizer");
                    break;
            }
        }
    }
}
```

Python:

```python
class RunningModeSample():
    def on_start(self):
        if api.RunningMode == RunningMode.RealTime:
            api.Print("Trading on live market data")
        elif api.RunningMode == RunningMode.SilentBacktesting:
            api.Print("Backtesting with the visual mode off")
        elif api.RunningMode == RunningMode.VisualBacktesting:
            api.Print("Backtesting with the visual mode on")
        elif api.RunningMode == RunningMode.Optimization:
            api.Print("Running in the optimizer")
```

config.json:

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

## Values

- `RunningMode.RealTime` — The cBot is running in real time.
- `RunningMode.SilentBacktesting` — The cBot is running in the silent backtesting mode.
- `RunningMode.VisualBacktesting` — The cBot is running in the visual backtesting mode.
- `RunningMode.Optimization` — The cBot is running in the optimization mode.

