Skip to content

ChartTemplateRobots

Summary

The interface representing a chart template robots instances collection.

Signature

1
public abstract interface ChartTemplateRobots

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 using cAlgo.API;
 namespace cAlgo.Robots;
 [Robot(AccessRights = AccessRights.None, AddIndicators = true)]
 public class ChartTemplate : Robot
 {
     protected override void OnStart()
     {
         var template = ChartTemplates.Get("Template Name");
         if (template is null)
         {
             Print("Template not found");
             return;
         }
         template.Indicators.Add("Simple Moving Average", Bars.OpenPrices, 100);
     }
 }

Methods

Add (2)

Add (1 of 2)

Summary

Adds a new Robot instance to a chart template.

Signature

1
public abstract ChartTemplateRobot Add(string name, object[] parameterValues)

Parameters

Name Type Description
name string The name of a Robot.
parameterValues object[] The Robot parameter values or an anonymous object that contains Robot parameter values.

Return Value

ChartTemplateRobot

Add (2 of 2)

Summary

Adds a new Robot instance to a chart template.

Signature

1
public abstract ChartTemplateRobot Add(RobotType type, object[] parameterValues)

Parameters

Name Type Description
type RobotType The type of Robot, you can get RobotType from AlgoRegistry.
parameterValues object[] The Robot parameter values or an anonymous object that contains Robot parameter values.

Return Value

ChartTemplateRobot

Remove

Summary

Removes a Robot instance from a chart template.

Signature

1
public abstract bool Remove(ChartTemplateRobot chartTemplateRobot)

Parameters

Name Type Description
chartTemplateRobot ChartTemplateRobot The ChartTemplateRobot to be removed from a chart template.

Return Value

bool

Get

Summary

Returns a chart template robot by type if exists otherwise null.

Signature

1
public abstract ChartTemplateRobot Get(string id)

Parameters

Name Type Description
id string The id of Robot, you can get.

Return Value

ChartTemplateRobot

Properties

Count

Summary

Gets the number of all Robots attached to a chart.

Signature

1
public abstract int Count {get;}

Return Value

int