Skip to content

BacktestingError

enum cAlgo.API

DesktopCLICloud

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

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 enum BacktestingError

Namespace: cAlgo.API · Group: Backtesting

Examples

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);
}
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

Name Value Description
None 0 %DOCUMENTATION%
Other 1 %DOCUMENTATION%
Net4IsNotSupported 79 %DOCUMENTATION%
NoConnection 80 %DOCUMENTATION%
NoHistoricalData 86 %DOCUMENTATION%
NotSupported 91 %DOCUMENTATION%
InvalidSettings 92 %DOCUMENTATION%

See also