I have used 'DrawRegion' to fill between two plots but I want the fill to start and end at specific times. I have done the following:
In the 'Initialize' I have:
private DateTime zonestart;
private DateTime zoneend;
'OnBarUpdate'
zonestart = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 08, 30, 0);
zoneend = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 15, 14, 0);
DrawRegion("Zone", zonestart, zoneend, HighestHigh, LowestLow,Color.Empty, Color.Blue, opacity);
I still have my plots/dataseries on the chart that I want to fill between but no fill. If I use '0' and 'CurrentBar' instead of 'zonestart' etc I get a fill but it doesn't terminate until midnight. The help file isn't particularly helpful as it only gives an example for 'BarsAgo'. I have tried putting in the times '083000' and '151400' but that doesn't work either. Also tried turning these into integers with 'int zonestartBarsAgo = GetBar(zonestart);' This didn't work either.
What is the obvious answer I am missing please.
Thanks;
Ben.

Comment