RobotState
enum cAlgo.API
DesktopCLICloud
Represents the predefined states of a Robot instance.
Definition
public enum RobotState
Namespace: cAlgo.API · Group: Robots
Examples
using cAlgo.API;
namespace cAlgo.Robots;
public partial class TestExample : Robot
{
protected override void OnStart()
{
foreach (var chartRobot in ChartRobots)
{
Print($"Name: {chartRobot.Name} | State: {chartRobot.State}");
}
}
}
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}")
{
"AccessRights": "None"
}
Values
| Name | Value | Description |
|---|---|---|
Stopped | 0 | Robot instance is stopped. |
Running | 1 | Robot instance is running. |
Stopping | 2 | Stop was requested, but Robot instance has not stopped yet |
Restarting | 3 | Restarting Robot instance because of crash or change of parameters, symbols, account, etc. |