Hi Pete, could you please try adding the previous day’s HLC to the code below with the same formatting? Thank you
***************************************************
declare hide_on_daily;
input PlotOverNightExtremes = yes;
input DisplayPriceBubbleOnHiLowBar = yes;
input DisplayPriceBubbleOnRightEdge = yes;
def o = open;
def h = high;
def l = low;
def c = close;
def v = volume;
def bar = BarNumber();
def GDF = GetTime() < RegularTradingStart(GetYYYYMMDD());
def vol = if GDF and !GDF[1]
then v
else if GDF
then vol[1] + v
else Double.NaN;
def GDF_Volume = vol;
def ONhigh = if GDF and !GDF[1]
then h
else if GDF and
h > ONhigh[1]
then h
else ONhigh[1];
def ONhighBar = if GDF and h == ONhigh
then bar
else Double.NaN;
def ONlow = if GDF and !GDF[1]
then l
else if GDF and
l < ONlow[1]
then l
else ONlow[1];
def ONlowBar = if GDF and l == ONlow
then bar
else Double.NaN;
def OverNightHigh = if BarNumber() == HighestAll(ONhighBar)
then ONhigh
else OverNightHigh[1];
def OverNightLow = if BarNumber() == HighestAll(ONlowBar)
then ONlow
else OverNightLow[1];
#
plot ONH = if OverNightHigh > 0
then OverNightHigh
else Double.NaN;
ONH.SetHiding(!PlotOverNightExtremes);
ONH.SetPaintingStrategy(PaintingStrategy.SQUARES);
ONH.SetDefaultColor(Color.BLUE);
ONH.HideBubble();
ONH.HideTitle();
#
plot ONL = if OverNightLow > 0
then OverNightLow
else Double.NaN;
ONL.SetHiding(!PlotOverNightExtremes);
ONL.SetPaintingStrategy(PaintingStrategy.SQUARES);
ONL.SetDefaultColor(Color.LIGHT_GRAY);
ONL.HideBubble();
ONL.HideTitle();
# Bubble code
AddChartBubble(bar == ONhighBar and PlotOverNightExtremes and DisplayPriceBubbleOnHiLowBar, ONH, “ONH: ” + ONH, createColor(204,204,255));
AddChartBubble(bar == ONlowBar and PlotOverNightExtremes and DisplayPriceBubbleOnHiLowBar, ONL, “ONL: ” + ONL, createColor(204,204,255),no); #designated that the bubble be painted below the ONL line. 2018-04-07 JQ
AddChartBubble(barNumber() == highestAll(barnumber()) and PlotOverNightExtremes and DisplayPriceBubbleOnRightEdge, ONH, “ONH: ” + ONH, createColor(204,204,255));
AddChartBubble(barNumber() == highestAll(barnumber()) and PlotOverNightExtremes and DisplayPriceBubbleOnRightEdge, ONL, “ONL: ” + ONL, createColor(204,204,255),no);
Like this:
Like Loading...
So when you say “HLC” do you mean (high + low + close) / 3?
Does that computation need to include premarket hours trade or only regular session trade?
Thanks for your response, Pete. Sorry for the lack of clarity. I meant the previous day’s High, Low and Close price levels to be plotted separately at the level extremes like the code to pre-market above shows.
Thank you for your help.
Ok, daily high, low and close. Still need to know….”to include premarket hours trade or only regular session trade”
Sorry, with pre-market hours. Much appreciated!