I have set up background colors in RegionHighLight. It is okay visually for testing but I would like to use the start bar / start time of some of the zones programically in another indicator. As the color regions adjust for DST and holidays I cant just nominate a time where each region starts. I assume the easiest way to do that is to find the first bar and do an ADDPLOT that I can reference in the other indicator. I have the code below set up for the color regions.
for (int i = 0; i < AStructArray.Length; i++) // Color Time Regions - Set to plot repeatedly
{
Draw.RegionHighlightX(this, "TimeRegion" + Time[0].Date.ToString() + i, Time[0].Date + AStructArray[i].StartTime,
Time[0].Date + AStructArray[i].EndTime, Brushes.Transparent, AStructArray[i].Color, AStructArray[i].AreaOpacity);
}
I can also set it up to draw a dot at one height througout (horizontal line of dots at the same LOW) which also cant be accessed programically, so looking to do something the same but as an ADDPLOT
Draw.Dot(this, "StartTime" + Time[0].Date.ToString() + i, true, Time[0].Date + AStructArray[i].StartTime,
Lows[0][0], Brushes.Blue, true);
I have tried the following inside the above FOR loop which does not work correctly because I was trying to plot into the future using StartTime and using EndTime only plots once in the wrong location.
if (i == 1)
{
chicStartTime = Time[0].Date + AStructArray[i].EndTime;
barsAgoChicStart = CurrentBar - Bars.GetBar(chicStartTime);
if (barsAgoChicStart == 0)
{
ChicStart[0] = Lows[0][0] - TickSize*25;
}
Can someone point me in the right direction because I am not sure if I am close or miles away from the correct method and code. Thanks.

Comment