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

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

# BacktestingCompletedEventArgs (class)

Provides data for the backtesting completed event.

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 class BacktestingCompletedEventArgs
```

## Examples

C#:

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

private void OnBacktestingCompleted(BacktestingCompletedEventArgs args)
{
    Print("Backtesting completed with error {0}, has HTML report: {1}", args.Process.BacktestingError, args.HtmlReport != null);
}
```

Python:

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

def on_backtesting_completed(self, args):
    api.Print(f"Backtesting completed with error {args.Process.BacktestingError}, has HTML report: {args.HtmlReport is not None}")
```

## Properties

- `public string HtmlReport {get;}` — Gets the HTML report of the backtesting results. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/BacktestingCompletedEventArgs/HtmlReport/index.md)
- `public string JsonReport {get;}` — Gets the JSON report of the backtesting results. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/BacktestingCompletedEventArgs/JsonReport/index.md)
- `public BacktestingProcess Process {get;}` — Gets the backtesting process that has completed. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/BacktestingCompletedEventArgs/Process/index.md)

