Skip to content

ChartRectangle.Time2

property · ChartRectangle · cAlgo.API

DesktopCLICloud

Gets or sets the value 2 on the Time line.

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

DateTime Time2 {get; set;}
chartRectangle.Time2: DateTime

Returns DateTime

Examples

var rectangle = Chart.DrawRectangle("zone", Bars.OpenTimes.Last(20), Bars.LowPrices.Last(20), Bars.OpenTimes.LastValue, Bars.HighPrices.LastValue, Color.FromArgb(80, Color.Blue));
rectangle.Time2 = Bars.OpenTimes.LastValue.AddHours(12);
Print("Zone end time: {0}", rectangle.Time2);
rectangle = api.Chart.DrawRectangle("zone", api.Bars.OpenTimes.Last(20), api.Bars.LowPrices.Last(20), api.Bars.OpenTimes.LastValue, api.Bars.HighPrices.LastValue, Color.FromArgb(80, Color.Blue))
rectangle.Time2 = api.Bars.OpenTimes.LastValue.AddHours(12)
api.Print(f"Zone end time: {rectangle.Time2}")