ChartContainers.ContainersAdded
event · ChartContainers · cAlgo.API
DesktopCLICloud
Occurs when new containers are added.
Environment behaviour
CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.
Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.
Definition
event Action<ChartContainersAddedEventArgs> ContainersAdded;
chartContainers.ContainersAdded += handler # handler(obj: ChartContainersAddedEventArgs)
Examples
protected override void OnStart()
{
ChartManager.ChartContainers.ContainersAdded += OnContainersAdded;
}
private void OnContainersAdded(ChartContainersAddedEventArgs args)
{
foreach (var chartContainer in args.AddedChartContainers)
Print("Chart container added: {0}", chartContainer.Id);
}
def on_start(self):
api.ChartManager.ChartContainers.ContainersAdded += self.on_containers_added
def on_containers_added(self, args):
for chartContainer in args.AddedChartContainers:
api.Print(f"Chart container added: {chartContainer.Id}")