ChartTemplates.Added
event · ChartTemplates · cAlgo.API Since 5.6
DesktopCLICloud
Occurs when a new chart template is added.
Environment behaviour
CLI — works differently. No templates are listed; Create works for this run only and is not saved; Remove returns false; DefaultTemplate throws NullReferenceException.
Cloud — not supported. Empty: Get returns null, Contains and Remove return false, Create and Duplicate throw, DefaultTemplate throws NullReferenceException.
Definition
event Action<ChartTemplateAddedEventArgs> Added;
api.ChartTemplates.Added += handler # handler(obj: ChartTemplateAddedEventArgs)
Examples
protected override void OnStart()
{
ChartTemplates.Added += OnChartTemplateAdded;
}
private void OnChartTemplateAdded(ChartTemplateAddedEventArgs args)
{
Print("Chart template added: {0}", args.ChartTemplate.Name);
}
def on_start(self):
api.ChartTemplates.Added += self.on_chart_template_added
def on_chart_template_added(self, args):
api.Print(f"Chart template added: {args.ChartTemplate.Name}")