---
id: "T:cAlgo.API.BacktestingError"
kind: "enum"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/BacktestingError/"
---

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

# BacktestingError (enum)

Specifies the error that stopped a backtesting process, None if there was no error.

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

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

## Definition

```csharp
public enum BacktestingError
```

## Examples

C#:

```csharp
protected override void OnStart()
{
    Backtesting.Completed += OnBacktestingCompleted;
}

private void OnBacktestingCompleted(BacktestingCompletedEventArgs args)
{
    if (args.Process.BacktestingError == BacktestingError.None)
        Print("Backtesting finished successfully");
    else
        Print("Backtesting failed: {0}", args.Process.BacktestingError);
}
```

Python:

```python
def on_start(self):
    api.Backtesting.Completed += self.on_backtesting_completed

def on_backtesting_completed(self, args):
    # None is a Python keyword, so the enum value is read with getattr
    if args.Process.BacktestingError == getattr(BacktestingError, "None"):
        api.Print("Backtesting finished successfully")
    else:
        api.Print(f"Backtesting failed: {args.Process.BacktestingError}")
```

## Values

- `BacktestingError.None` — %DOCUMENTATION%
- `BacktestingError.Other` — %DOCUMENTATION%
- `BacktestingError.Net4IsNotSupported` — %DOCUMENTATION%
- `BacktestingError.NoConnection` — %DOCUMENTATION%
- `BacktestingError.NoHistoricalData` — %DOCUMENTATION%
- `BacktestingError.NotSupported` — %DOCUMENTATION%
- `BacktestingError.InvalidSettings` — %DOCUMENTATION%

