ChartTemplate
interface cAlgo.API Since 5.6
DesktopCLICloud
Represents chart template.
Environment behaviour
Cloud — not supported. Never available in the cloud: it is only returned by members that do not work there (ChartTemplates, ChartTemplates.Create, ChartTemplates.DefaultTemplate and more).
Definition
public interface ChartTemplate
Namespace: cAlgo.API · Group: Templates
Examples
using cAlgo.API;
namespace cAlgo.Robots;
public partial class ChartTemplate : Robot
{
protected override void OnStart()
{
foreach (var chartTemplate in ChartTemplates)
{
Print($"Name: {chartTemplate.Name} | Indicators: {chartTemplate.Indicators.Count} | Robots: {chartTemplate.Robots.Count}");
}
ChartTemplates.Get("Template Name")?.Apply(Chart);
}
}
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):
for chartTemplate in api.ChartTemplates:
print(f"Name: {chartTemplate.Name} | Indicators: {chartTemplate.Indicators.Count} | Robots: {chartTemplate.Robots.Count}")
api.ChartTemplates.Get("Template Name").Apply(api.Chart)
{
"AccessRights": "None",
"AddIndicators": true
}
Methods
| Name | Description |
|---|---|
ApplyDesktopCLICloudvoid | Applies current chart template to a chart. |
Properties
| Name | Description |
|---|---|
ColorSettingsDesktopCLICloudChartTemplateColorSettings | Gets the chart template color settings. |
DisplaySettingsDesktopCLICloudChartTemplateDisplaySettings | Gets the chart template display settings. |
IndicatorsDesktopCLICloudChartTemplateIndicators | Gets the indicators of chart template. |
NameDesktopCLICloudstring | Gets the chart template name. |
RobotsDesktopCLICloudChartTemplateRobots | Gets the robots of chart template. |