ChartRobots.Item
property · ChartRobots · cAlgo.API
DesktopCLICloud
Gets a Robot attached instance to a chart by its instance ID.
Environment behaviour
Cloud — not supported. Always empty: Count is 0, Add returns null, Remove returns false, and the events never fire.
Definition
ChartRobot Item {get;}
api.ChartRobots[instanceId: str] -> ChartRobot
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
instanceId | string | str | The instance ID of a Robot attached to a chart. |
Returns ChartRobot
Examples
var added = ChartRobots.Add("Sample Break Even");
var chartRobot = ChartRobots[added.InstanceId];
if (chartRobot != null)
Print("Found cBot: {0} | State: {1}", chartRobot.Name, chartRobot.State);
added = api.ChartRobots.Add("Sample Break Even")
chartRobot = api.ChartRobots[added.InstanceId]
if chartRobot is not None:
api.Print(f"Found cBot: {chartRobot.Name} | State: {chartRobot.State}")