#Previous Day High, Low, Close with options to limit what is shown
input showtodayonly = yes;
input showhigh = yes;
input showlow = yes;
plot dayhigh = if showhigh == yes
then if IsNaN(close) or showtodayonly and !IsNaN(close(period = AggregationPeriod.DAY)[-1])
then Double.NaN
else high(period = AggregationPeriod.DAY)[1]
else Double.NaN;
dayhigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
dayhigh.SetDefaultColor(Color.GREEN);
plot daylow = if showlow == yes
then if IsNaN(close) or showtodayonly and !IsNaN(close(period = AggregationPeriod.DAY)[-1])
then Double.NaN
else low(period = AggregationPeriod.DAY)[1]
else Double.NaN;
daylow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
daylow.SetDefaultColor(Color.RED);
plot monhigh = if showhigh == yes
then if IsNaN(close) or showtodayonly and !IsNaN(close(period = AggregationPeriod.MONTH)[-1])
then Double.NaN
else high(period = AggregationPeriod.MONTH)[1]
else Double.NaN;
monhigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
monhigh.SetDefaultColor(Color.GREEN);
plot monlow = if showlow == yes
then if IsNaN(close) or showtodayonly and !IsNaN(close(period = AggregationPeriod.MONTH)[-1])
then Double.NaN
else low(period = AggregationPeriod.MONTH)[1]
else Double.NaN;
monlow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
monlow.SetDefaultColor(Color.RED);
plot qhigh = if showhigh == yes
then if IsNaN(close) or showtodayonly and !IsNaN(close(period = AggregationPeriod.QUARTER)[-1])
then Double.NaN
else high(period = AggregationPeriod.QUARTER)[1]
else Double.NaN;
qhigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
qhigh.SetDefaultColor(Color.GREEN);
plot qlow = if showlow == yes
then if IsNaN(close) or showtodayonly and !IsNaN(close(period = AggregationPeriod.QUARTER)[-1])
then Double.NaN
else low(period = AggregationPeriod.QUARTER)[1]
else Double.NaN;
qlow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
qlow.SetDefaultColor(Color.RED);
input showbubbles = yes;
input bubblemover = 3;
def b = bubblemover;
def b1 = b + 1;
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), dayhigh[b1], "PDH", Color.GREEN);
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), monhigh[b1], "PMH", Color.GREEN);
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), qhigh[b1], "PQH", Color.GREEN);
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), daylow[b1], "PDL", Color.RED);
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), monlow[b1], "PML", Color.RED);
AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), qlow[b1], "PQL", Color.RED);