Skip to content

RobotAttribute

class cAlgo.API

DesktopCLICloud

Sealed class RobotAttribute.

Definition

public sealed class RobotAttribute : Attribute

Namespace: cAlgo.API · Group: Attributes

Remarks

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

Examples

using cAlgo.API;

namespace cAlgo.Robots
{
    // config.json declares the cBot settings, the class holds only the code
    public partial class RobotAttributeSample : Robot
    {
        protected override void OnStart()
        {
            Print("cBot started on {0}, time zone {1}", SymbolName, TimeZone.DisplayName);
        }
    }
}
class RobotAttributeSample():
    def on_start(self):
        api.Print(f"cBot started on {api.SymbolName}, time zone {api.TimeZone.DisplayName}")
{
  "AccessRights": "None",
  "TimeZone": "UTC"
}

Constructors

Name Description
RobotAttributeDesktopCLICloud Initializes a new RobotAttribute instance.

Properties

Name Description
AccessRightsDesktopCLICloudAccessRights Gets or sets the access rights required for the cBot.
AddIndicatorsDesktopCLICloudbool Gets or sets whether indicators created by robot will be added to chart or not.
AdditionalInfoUrlDesktopCLICloudstring Gets or sets additional info url.
DefaultSymbolNameDesktopCLICloudstring Not used. cTrader applies no default symbol to a cBot: a new instance runs on the symbol it is added with, which the cBot reads from SymbolName.
DefaultTimeFrameDesktopCLICloudstring Not used. cTrader applies no default time frame to a cBot: a new instance runs on the time frame of the chart it is added to, which the cBot reads from TimeFrame.
NameDesktopCLICloudstring The name of a robot. Sets from constructor.
TimeZoneDesktopCLICloudstring Sets the timezone for all the robot or indicator datetime references
Deprecated members (1)
  • public RobotAttribute(string name) — Deprecated.