Skip to content

RunningMode

Summary

Defines if a cBot is running in real time, in the silent backtesting mode, in the visual backtesting mode, or in the optimization mode.

Signature

1
public enum RunningMode

Namespace

cAlgo.API

Fields

Name Description
RealTime The cBot is running in real time.
SilentBacktesting The cBot is running in the silent backtesting mode.
VisualBacktesting The cBot is running in the visual backtesting mode.
Optimization The cBot is running in the optimization mode.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 using cAlgo.API;
 namespace cAlgo.Robots
 {
     // This sample shows how to use the RunningMode property of your robot
     [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class RunningModeSample : Robot
     {
         protected override void OnStart()
         {
             switch (RunningMode)
             {
                 case RunningMode.RealTime:
                     // If the robot is running on real time market condition
                     break;
                 case RunningMode.SilentBacktesting:
                     // If the robot is running on backtest and the visual mode is off
                     break;
                 case RunningMode.VisualBacktesting:
                     // If the robot is running on backtest and the visual mode is on
                     break;
                 case RunningMode.Optimization:
                     // If the robot is running on optimizer
                     break;
             }
         }
     }
 }

Last update: July 1, 2022

Comments