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.

Syntax

public sealed enum RunningMode

Members

NameTypeSummary
Optimization FieldThe cBot is running in the optimization mode.
RealTime FieldThe cBot is running in real time.
SilentBacktesting FieldThe cBot is running in the silent backtesting mode.
VisualBacktesting FieldThe cBot is running in the visual backtesting mode.

Example 1

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