Is there a parameter I need to add to the code to be able to do this or another approach? Its a very simple indicator just missing something here.
I'm trying to get the Y value from the time at 8:28am CST to 8:30am CST and use that as the high and low or the y values to draw the rectangle.
Code itself:
protected override void OnBarUpdate()
{
if(ToTime(Time[0]) == ToTime(8,30,0) ) {
Draw.Rectangle(this, "startTime" + CurrentBar, false,Time[0], Low[0] - TickSize, new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 16, 15, 0), High[0], Brushes.Transparent, Brushes.Yellow, 30);
}
if(ToTime(Time[0]) == ToTime(9,30,0) ) {
Draw.Rectangle(this, "startTime" + CurrentBar,Time[0], Low[0] - TickSize, new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 16, 15, 0), High[0], Brushes.Transparent);
}
}

Comment