OptimizationPass
interface cAlgo.API Since 5.9
DesktopCLICloud
Represents a single completed optimization pass and its key statistics.
Environment behaviour
CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.
Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.
Definition
public interface OptimizationPass
Namespace: cAlgo.API · Group: Optimization
Examples
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);
}
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
| Name | Description |
|---|---|
FitnessDesktopCLIClouddouble | Gets the fitness value of the pass. |
IdDesktopCLICloudint | Gets the pass id. |
JsonReportDesktopCLICloudstring | Gets the full per-pass backtest result as JSON. |
MaxEquityDrawdownPercentagesDesktopCLIClouddouble | Gets the maximum equity drawdown of the pass, as a percentage. |
NetProfitDesktopCLIClouddouble | Gets the net profit of the pass. |
ParameterValuesDesktopCLICloudIReadOnlyDictionary<string, string> | Gets the exact parameter values this pass used, keyed by parameter name. |
ProfitFactorDesktopCLIClouddouble | Gets the profit factor of the pass. |
TimeFrameDesktopCLICloudTimeFrame | Gets the time frame of the pass. |
TotalTradesDesktopCLICloudint | Gets the total number of trades in the pass. |