Skip to content

RobotState

Summary

Represents the predefined states of a Robot instance.

Signature

1
public enum RobotState

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 using cAlgo.API;
 namespace cAlgo.Robots;
 [Robot(AccessRights = AccessRights.None)]
 public class TestExample : Robot
 {
    protected override void OnStart()
    {
        foreach (var chartRobot in ChartRobots)
        {
             Print($"Name: {chartRobot.Name} | State: {chartRobot.State}");
        }
    }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 import clr
 clr.AddReference("cAlgo.API")
 # Import cAlgo API types
 from cAlgo.API import *
 # Import trading wrapper functions
 from robot_wrapper import *
 class Test():
     def on_start(self):
         for chartRobot in api.ChartRobots:
             print(f"Name: {chartRobot.Name} | State: {chartRobot.State}")

See Also

Fields

Stopped

Summary

Robot instance is stopped.

Signature

1
RobotState.Stopped;

Return Value

RobotState

Running

Summary

Robot instance is running.

Signature

1
RobotState.Running;

Return Value

RobotState

Stopping

Summary

Stop was requested, but Robot instance has not stopped yet

Signature

1
RobotState.Stopping;

Return Value

RobotState

Restarting

Summary

Restarting Robot instance because of crash or change of parameters, symbols, account, etc.

Signature

1
RobotState.Restarting;

Return Value

RobotState