Skip to content

ChartRobotEventArgs.Robot

property · ChartRobotEventArgs · cAlgo.API

DesktopCLICloud

Gets the ChartRobot that raised an event.

Environment behaviour

Cloud — not supported. Never raised in the cloud: the ChartRobots events never fire there.

Definition

public ChartRobot Robot {get;}
chartRobotEventArgs.Robot: ChartRobot

Returns ChartRobot

Examples

protected override void OnStart()
{
    Chart.Robots.RobotStarted += OnChartRobotStarted;
}

private void OnChartRobotStarted(ChartRobotStartedEventArgs args)
{
    var robot = args.Robot;
    Print("Name: {0} | Instance: {1} | State: {2}", robot.Name, robot.InstanceId, robot.State);
}
def on_start(self):
    api.Chart.Robots.RobotStarted += self.on_chart_robot_started

def on_chart_robot_started(self, args):
    robot = args.Robot
    api.Print(f"Name: {robot.Name} | Instance: {robot.InstanceId} | State: {robot.State}")