Skip to content

ChartObject.IsAlive

property · ChartObject · cAlgo.API

DesktopCLICloud

Defines if the chart object still exists on the chart.

Environment behaviour

CLI — works differently. Created and kept with all its properties, but never drawn: the CLI displays no chart.

Cloud — works differently. Created and kept with all its properties, but never drawn: the cloud displays no chart.

Definition

bool IsAlive {get;}
chartObject.IsAlive: bool

Returns bool

Examples

var line = Chart.DrawHorizontalLine("support", Bars.LowPrices.LastValue, Color.Green);
Chart.RemoveObject(line.Name);
Print("Line still on the chart: {0}", line.IsAlive);
line = api.Chart.DrawHorizontalLine("support", api.Bars.LowPrices.LastValue, Color.Green)
api.Chart.RemoveObject(line.Name)
api.Print(f"Line still on the chart: {line.IsAlive}")