Skip to content

BacktestingCompletedEventArgs.HtmlReport

property · BacktestingCompletedEventArgs · cAlgo.API

DesktopCLICloud

Gets the HTML report of the backtesting results.

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 string HtmlReport {get;}
backtestingCompletedEventArgs.HtmlReport: str

Returns string

Examples

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

private void OnBacktestingCompleted(BacktestingCompletedEventArgs args)
{
    if (args.HtmlReport == null)
        return;
    var customFrame = ChartManager.AddCustomFrame("Backtesting Report");
    var webView = new WebView();
    webView.Loaded += _ => webView.NavigateToStringAsync(args.HtmlReport);
    customFrame.Child = webView;
}
def on_start(self):
    api.Backtesting.Completed += self.on_backtesting_completed

def on_backtesting_completed(self, args):
    if args.HtmlReport is not None:
        api.Print(f"HTML report length: {len(args.HtmlReport)}")