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

DefaultSymbolName

Summary

Gets or sets the name of the default symbol for which new instances are created.

Signature

1
public string DefaultSymbolName {get; set;}

Return Value

string

Examples

1
2
 [Robot(DefaultSymbolName = "GBPJPY")]  
 public class DefaultSymbolExampleBot: Robot  

DefaultTimeFrame

Summary

Gets or sets the default timeframe of the chart to which new instances are added.

Signature

1
public string DefaultTimeFrame {get; set;}

Return Value

string

Examples

1
2
 [Robot(DefaultTimeFrame = "M1")]  
 public class DefaultTimeFrameExampleBot : Robot  

AddIndicators

Summary

Gets or sets whether indicators created by robot will be added to chart or not.

Remarks

Default value is false.

Signature

1
public bool AddIndicators {get; set;}

Return Value

bool