RunningMode
enum cAlgo.API
DesktopCLICloud
Defines if a cBot is running in real time, in the silent backtesting mode, in the visual backtesting mode, or in the optimization mode.
Definition
public enum RunningMode
Namespace: cAlgo.API · Group: Application
Examples
using cAlgo.API;
namespace cAlgo.Robots
{
// This sample shows how to use the RunningMode property of your robot
public partial class RunningModeSample : Robot
{
protected override void OnStart()
{
switch (RunningMode)
{
case RunningMode.RealTime:
Print("Trading on live market data");
break;
case RunningMode.SilentBacktesting:
Print("Backtesting with the visual mode off");
break;
case RunningMode.VisualBacktesting:
Print("Backtesting with the visual mode on");
break;
case RunningMode.Optimization:
Print("Running in the optimizer");
break;
}
}
}
}
class RunningModeSample():
def on_start(self):
if api.RunningMode == RunningMode.RealTime:
api.Print("Trading on live market data")
elif api.RunningMode == RunningMode.SilentBacktesting:
api.Print("Backtesting with the visual mode off")
elif api.RunningMode == RunningMode.VisualBacktesting:
api.Print("Backtesting with the visual mode on")
elif api.RunningMode == RunningMode.Optimization:
api.Print("Running in the optimizer")
{
"AccessRights": "None",
"TimeZone": "UTC"
}
Values
| Name | Value | Description |
|---|---|---|
RealTime | 0 | The cBot is running in real time. |
SilentBacktesting | 1 | The cBot is running in the silent backtesting mode. |
VisualBacktesting | 2 | The cBot is running in the visual backtesting mode. |
Optimization | 3 | The cBot is running in the optimization mode. |