from the helpguide and the forum I know how to plot a rectangle a specific time of day. But I can´t find the solution for plotting the rectangle with a start time > stop time of plotting. The start time is eg at 16:00 where it should start to plot and the stop time of plotting eg is 9:00.
Now I have from an indicator
int BarMinute = Time[1].Minute;
int BarHour = Time[1].Hour;
int BarDay = Time[1].Day;
int BarMonth = Time[1].Month;
int BarYear = Time[1].Year;
int start = CurrentBars[1]-Bars.GetBar(new DateTime(BarYear, BarMonth, BarDay, StartHour, StartMinute,0));
int stop = CurrentBars[1]-Bars.GetBar(new DateTime(BarYear, BarMonth, BarDay, StopHour, StopMinute,0));
if (xNow.Date==Times[0][0].Date && start >= 0 && stop <= 0 )
{Draw.Rectangle(this,"hl", true, new DateTime (BarYear,BarMonth, BarDay,StartHour, StartMinute,0), lowtz1, new DateTime (BarYear, BarMonth, BarDay,StopHour, StopMinute,0), hightz1, timecolor, timecolor, Opacity);}
What is to change please so that it plots the rectangle from yesterday 16:00 untill today 9:00 (for every day).
Thank you!
Tony
Comment