ChartIndicators.IndicatorAdded
event · ChartIndicators · cAlgo.API
DesktopCLICloud
Occurs when a new indicator is added to a chart.
Environment behaviour
Cloud — not supported. Always empty: Count is 0, Add returns null, Remove returns false, and the events never fire.
Definition
event Action<ChartIndicatorAddedEventArgs> IndicatorAdded;
api.ChartIndicators.IndicatorAdded += handler # handler(obj: ChartIndicatorAddedEventArgs)
Examples
protected override void OnStart()
{
ChartIndicators.IndicatorAdded += OnIndicatorAdded;
}
private void OnIndicatorAdded(ChartIndicatorAddedEventArgs args)
{
Print("Indicator added: {0}", args.Indicator.Name);
}
def on_start(self):
api.ChartIndicators.IndicatorAdded += self.on_indicator_added
def on_indicator_added(self, args):
api.Print(f"Indicator added: {args.Indicator.Name}")