I tried to do the following and realized it only worked for DrawRegion function (plotted historically) but not for DrawRectangle and DrawLine function (only current high/low was plotted) .What if I'd lke to plot the high and low by using DrawRectangle and DrawLine? Advice needed. Thanks!
if (Bars == null)
return;
if (!Data.BarsType.GetInstance(Bars.Period.Id).IsIntr aday )
return;
if (Bars.Period.Id == PeriodType.Minute && Bars.Period.Value > minutes/2)
return;
if(!isLoaded && !isInit)
{
isInit = true;
hourlyBars= Data.Bars.GetBars(Bars.Instrument, new Period(PeriodType.Minute, minutes, MarketDataType.Last), Bars.From, Bars.To, (Session) Bars.Session.Clone(), Data.Bars.SplitAdjust,
Data.Bars.DividendAdjust);
existsHistHourlyData = (hourlyBars.Count <= 1) ? false : true;
isInit = false;
isLoaded = true;
}
IBar hourlyBar;
if (CurrentBar == 0) return;
if (existsHistHourlyData)
{
DateTime intradayBarTime01 = Time[0].AddMinutes(-minutes);
hourlyBar = hourlyBars.Get(hourlyBars.GetBar(intradayBarTime01 ));
h01.Set (hourlyBar.High);
l01.Set (hourlyBar.Low);
DrawRegion ("a", CurrentBar, 0, h01, l01, Color.Transparent, Color.PowderBlue , 5);
DrawRectangle("b", false, CurrentBar, h01[0], 0, l01[0], Color.Lime, Color.Transparent, 0);
DrawLine ("c", false, CurrentBar, h01[0], 0, h01[0], Color.Khaki, DashStyle.Dot, 5);
}

Comment