def MonthHigh = high(period=aggregationPeriod.MONTH)[1];
def MonthLow = low(period=aggregationPeriod.MONTH)[1];
def MonthOpen = open(period=aggregationPeriod.MONTH)[1];
def MonthClose = close(period=aggregationPeriod.MONTH)[1];
def WeekHigh = high(period=aggregationPeriod.WEEK)[1];
def WeekLow = low(period=aggregationPeriod.WEEK)[1];
def WeekOpen = open(period=aggregationPeriod.WEEK)[1];
def WeekClose = close(period=aggregationPeriod.WEEK)[1];
def DayHigh = high(period=aggregationPeriod.DAY)[1];
def DayLow = low(period=aggregationPeriod.DAY)[1];
def DayOpen = open(period=aggregationPeriod.DAY)[1];
def DayClose = close(period=aggregationPeriod.DAY)[1];
def Today = SecondsFromTime(0430)>=0 and SecondsTillTime(1700)>=0;
plot MHigh = if Today and !isnan(close) then MonthHigh else double.nan;
MHigh.SetStyle(Curve.SHORT_DASH);
plot MLow = if Today and !isnan(close) then MonthLow else double.nan;
MLow.SetStyle(Curve.SHORT_DASH);
plot MOpen = if Today and !isnan(close) then MonthOpen else double.nan;
MOpen.SetStyle(Curve.SHORT_DASH);
plot MClose = if Today and !isnan(close) then MonthClose else double.nan;
MClose.SetStyle(Curve.SHORT_DASH);
plot WHigh = if Today and !isnan(close) then WeekHigh else double.nan;
WHigh.SetStyle(Curve.SHORT_DASH);
plot WLow = if Today and !isnan(close) then WeekLow else double.nan;
WLow.SetStyle(Curve.SHORT_DASH);
plot WOpen = if Today and !isnan(close) then WeekOpen else double.nan;
WOpen.SetStyle(Curve.SHORT_DASH);
plot WClose = if Today and !isnan(close) then WeekClose else double.nan;
WClose.SetStyle(Curve.SHORT_DASH);
plot DHigh = if Today and !isnan(close) then DayHigh else double.nan;
DHigh.SetStyle(Curve.SHORT_DASH);
plot DLow = if Today and !isnan(close) then DayLow else double.nan;
DLow.SetStyle(Curve.SHORT_DASH);
plot DOpen = if Today and !isnan(close) then DayOpen else double.nan;
DOpen.SetStyle(Curve.SHORT_DASH);
plot DClose = if Today and !isnan(close) then DayClose else double.nan;
DClose.SetStyle(Curve.SHORT_DASH);
addchartbubble(!isnan(MHigh[1]) and isnan(MHigh),Mhigh[1],"Previous Month High "+Mhigh[1],color.white);
addchartbubble(!isnan(MLow[1]) and isnan(MLow),MLow[1],"Previous Month Low "+MLow[1],color.white);
addchartbubble(!isnan(MOpen[1]) and isnan(MOpen),MOpen[1],"Previous Month Open "+MOpen[1],color.white);
addchartbubble(!isnan(MClose[1]) and isnan(MClose),MClose[1],"Previous Month Close "+MClose[1],color.white);
addchartbubble(!isnan(WHigh[1]) and isnan(WHigh),WHigh[1],"Previous Week High "+WHigh[1],color.white);
addchartbubble(!isnan(WLow[1]) and isnan(WLow),WLow[1],"Previous Week Low "+WLow[1],color.white);
addchartbubble(!isnan(WOpen[1]) and isnan(WOpen),WOpen[1],"Previous Week Open "+WOpen[1],color.white);
addchartbubble(!isnan(WClose[1]) and isnan(WClose),WClose[1],"Previous Week Close "+WClose[1],color.white);
addchartbubble(!isnan(DHigh[1]) and isnan(DHigh),DHigh[1],"Previous Day High "+DHigh[1],color.white);
addchartbubble(!isnan(DLow[1]) and isnan(DLow),DLow[1],"Previous Day Low "+DLow[1],color.white);
addchartbubble(!isnan(DOpen[1]) and isnan(DOpen),DOpen[1],"Previous Day Open "+DOpen[1],color.white);
addchartbubble(!isnan(DClose[1]) and isnan(DClose),DClose[1],"Previous Day Close "+DClose[1],color.white);