Skip to content

Algo.IsBacktesting

property · Algo · cAlgo.API.Internals

DesktopCLICloud

True if a cBot is in the Backtesting mode, otherwise False.

Definition

public bool IsBacktesting {get;}
api.IsBacktesting: bool

Returns bool

Examples

if (IsBacktesting)
    Print("Backtesting, last bar open time: {0}", Bars.OpenTimes.LastValue);
if api.IsBacktesting:
    api.Print(f"Backtesting, last bar open time: {api.Bars.OpenTimes.LastValue}")