Skip to content

RobotAttribute

Summary

Sealed class RobotAttribute.

Remarks

Marks a class as a Robot. The Robot attribute cannot be ommited.

Signature

1
public sealed class RobotAttribute : Attribute

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 using cAlgo.API;
 namespace cAlgo.Robots
 {
     // This sample robot shows how to use the Robot attribute and its properties
     // Every cBot (Robot) must be annotated with this attribute
     [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class RobotAttributeSample : Robot
     {
     }
 }

Properties

Name

Summary

The name of a robot. Sets from constructor.

Signature

1
public string Name {get;}

Return Value

string

Examples

1
2
3
4
5
 [Robot("newRobot")]    //  newRobot is the name of the Robot
 public class myRobot : Robot
 {
     //...
 }

TimeZone

Summary

Sets the timezone for all the robot or indicator datetime references

Remarks

All dates and times within the robot or indicator will be converted to this timezone

Signature

1
public string TimeZone {get; set;}

Return Value

string

Examples

1
2
 [Robot(TimeZone = TimeZones.EasternStandardTime)]
 public class NewsRobot : Robot

AccessRights

Summary

Gets or sets the access rights required for the cBot.

Signature

1
public AccessRights AccessRights {get; set;}

Return Value

AccessRights

Related Tutorials