ChartTemplateIndicators
interface cAlgo.API Since 5.6
DesktopCLICloud
The interface representing a chart template indicator instances collection.
Environment behaviour
Cloud — not supported. Never available in the cloud: it is only returned by members that do not work there (ChartTemplate.Indicators).
Definition
public interface ChartTemplateIndicators
Namespace: cAlgo.API · Group: Templates
Examples
using cAlgo.API;
namespace cAlgo.Robots;
public partial 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);
}
}
import clr
clr.AddReference("cAlgo.API")
# Import cAlgo API types
from cAlgo.API import *
# Import trading wrapper functions
from robot_wrapper import *
class Test():
def on_start(self):
template = api.ChartTemplates.Get("Template Name")
if template is None:
print("Template not found")
return
template.Indicators.Add("Simple Moving Average", api.Bars.OpenPrices, 100)
{
"AccessRights": "None",
"AddIndicators": true
}
Methods
| Name | Description |
|---|---|
Add 2 overloadsDesktopCLICloudChartTemplateIndicator | Adds a new indicator to a chart template. |
GetDesktopCLICloudChartTemplateIndicator | Returns a chart template indicator by type if exists otherwise null. |
RemoveDesktopCLICloudbool | Removes an indicator from a chart template. |
Properties
| Name | Description |
|---|---|
CountDesktopCLICloudint | Gets the number of all indicators attached to a chart template. |