Skip to content

ChartRobot

Summary

The interface representing a Robot instance attached to a chart.Provides properties that allow for accessing various information about a Robot.

Signature

1
public abstract interface ChartRobot

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} | InstanceId: {chartRobot.InstanceId} | State: {chartRobot.State} | Type Name: {chartRobot.Type.Name}");
        }
    }
 }
 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} | InstanceId: {chartRobot.InstanceId} | State: {chartRobot.State} | Type Name: {chartRobot.Type.Name}")

See Also

Methods

Start

Summary

Starts the Robot instance.

Signature

1
public abstract void Start()

Return Value

void

Stop

Summary

Stops the Robot instance.

Signature

1
public abstract void Stop()

Return Value

void

Properties

Name

Summary

Gets the name of a Robot instance.

Signature

1
public abstract string Name {get;}

Return Value

string

InstanceId

Summary

Gets the ID of a specific Robot instance.

Signature

1
public abstract string InstanceId {get;}

Return Value

string

Type

Summary

Gets the RobotType of a Robot instance.

Signature

1
public abstract RobotType Type {get;}

Return Value

RobotType

Parameters

Summary

Gets the collection of Robot parameters.

Signature

1
public abstract AlgoInstanceParameters Parameters {get;}

Return Value

AlgoInstanceParameters

State

Summary

Gets the current state of a Robot instance.

Signature

1
public abstract RobotState State {get;}

Return Value

RobotState