Skip to content

ChartHorizontalLine.Color

property · ChartHorizontalLine · cAlgo.API

DesktopCLICloud

Gets or sets the line color.

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

Color Color {get; set;}
chartHorizontalLine.Color: Color

Returns Color

Examples

var line = Chart.DrawHorizontalLine("support", Bars.LowPrices.LastValue, Color.Green);
line.Color = Bars.ClosePrices.LastValue < line.Y ? Color.Red : Color.Green;
Print("Support line color: {0}", line.Color);
line = api.Chart.DrawHorizontalLine("support", api.Bars.LowPrices.LastValue, Color.Green)
line.Color = Color.Red if api.Bars.ClosePrices.LastValue < line.Y else Color.Green
api.Print(f"Support line color: {line.Color}")