---
id: "T:cAlgo.API.OptimizationPass"
kind: "interface"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationPass/"
---

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

# OptimizationPass (interface)

Represents a single completed optimization pass and its key statistics.

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 interface OptimizationPass
```

Available since cAlgo.API 5.9.

## Examples

C#:

```csharp
protected override void OnStart()
{
    Optimization.PassCompleted += args => PrintPass(args.Pass);
}

private void PrintPass(OptimizationPass pass)
{
    Print("Pass {0} ({1}): net profit {2}, profit factor {3}, max DD {4}%, trades {5}",
        pass.Id, pass.TimeFrame, pass.NetProfit, pass.ProfitFactor, pass.MaxEquityDrawdownPercentages, pass.TotalTrades);
}
```

Python:

```python
def on_start(self):
    api.Optimization.PassCompleted += lambda args: self.print_pass(args.Pass)

def print_pass(self, optimizationPass):
    api.Print(f"Pass {optimizationPass.Id} ({optimizationPass.TimeFrame}): net profit {optimizationPass.NetProfit}, profit factor {optimizationPass.ProfitFactor}, max DD {optimizationPass.MaxEquityDrawdownPercentages}%, trades {optimizationPass.TotalTrades}")
```

## Properties

- `double Fitness {get;}` — Gets the fitness value of the pass. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationPass/Fitness/index.md)
- `int Id {get;}` — Gets the pass id. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationPass/Id/index.md)
- `string JsonReport {get;}` — Gets the full per-pass backtest result as JSON. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationPass/JsonReport/index.md)
- `double MaxEquityDrawdownPercentages {get;}` — Gets the maximum equity drawdown of the pass, as a percentage. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationPass/MaxEquityDrawdownPercentages/index.md)
- `double NetProfit {get;}` — Gets the net profit of the pass. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationPass/NetProfit/index.md)
- `IReadOnlyDictionary<string, string> ParameterValues {get;}` — Gets the exact parameter values this pass used, keyed by parameter name. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationPass/ParameterValues/index.md)
- `double ProfitFactor {get;}` — Gets the profit factor of the pass. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationPass/ProfitFactor/index.md)
- `TimeFrame TimeFrame {get;}` — Gets the time frame of the pass. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationPass/TimeFrame/index.md)
- `int TotalTrades {get;}` — Gets the total number of trades in the pass. [details](https://help.ctrader.com/ctrader-algo/references/Plugin/Optimization/OptimizationPass/TotalTrades/index.md)

