Skip to content

BacktestingProcess.ProgressChanged

event · BacktestingProcess · cAlgo.API

DesktopCLICloud

Occurs when the backtesting progress changes.

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

event Action<BacktestingProgressChangedEventArgs> ProgressChanged;
backtestingProcess.ProgressChanged += handler  # handler(obj: BacktestingProgressChangedEventArgs)

Examples

if (AlgoRegistry.Get("Sample Trend cBot", AlgoKind.Robot) is not RobotType robotType)
    return;
var settings = new BacktestingSettings { StartTimeUtc = new DateTime(2025, 1, 1), EndTimeUtc = new DateTime(2025, 2, 1), Balance = 10000 };
var process = Backtesting.Start(robotType, "EURUSD", TimeFrame.Hour, settings);
process.ProgressChanged += args => Print("Progress: {0:F1}% - {1}", args.Progress, args.Operation);
from System import DateTime
algoType = api.AlgoRegistry.Get("Sample Trend cBot", AlgoKind.Robot)
if algoType is None:
    return
settings = BacktestingSettings()
settings.StartTimeUtc = DateTime(2025, 1, 1)
settings.EndTimeUtc = DateTime(2025, 2, 1)
settings.Balance = 10000
process = api.Backtesting.Start(RobotType(algoType), "EURUSD", TimeFrame.Hour, settings)
process.ProgressChanged += lambda args: api.Print(f"Progress: {args.Progress:.1f}% - {args.Operation}")