---
id: "P:cAlgo.API.Internals.Algo.IsBacktesting"
kind: "property"
type: "T:cAlgo.API.Internals.Algo"
url: "https://help.ctrader.com/ctrader-algo/references/General/Algo/IsBacktesting/"
---

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

# Algo.IsBacktesting

Member of [Algo](https://help.ctrader.com/ctrader-algo/references/General/Algo/index.md).

## IsBacktesting

True if a cBot is in the Backtesting mode, otherwise False.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public bool IsBacktesting {get;}
```

Python:

```python
api.IsBacktesting: bool
```

### Returns

`bool` — 

### Examples

C#:

```csharp
if (IsBacktesting)
    Print("Backtesting, last bar open time: {0}", Bars.OpenTimes.LastValue);
```

Python:

```python
if api.IsBacktesting:
    api.Print(f"Backtesting, last bar open time: {api.Bars.OpenTimes.LastValue}")
```

