#_1st_dayofMonth_Open_Close
input month = 7;
input year = 2024;
def mon = if GetYear() == year or month == 1 then GetMonth() else Double.NaN;
def mon_day_1 = if month == 1 then mon[1] == 12 and mon == month else mon[1] == month - 1 and mon == month;
def monthday1_open = if mon_day_1 then open else monthday1_open[1];
plot open_day_1 = if mon == month then monthday1_open else Double.NaN;
open_day_1.SetStyle(Curve.SHORT_DASH);
open_day_1.SetDefaultColor(Color.CYAN);
def monthday1_close = if mon_day_1 then close else monthday1_close[1];
plot close_day_1 = if mon == month then monthday1_close else Double.NaN;
close_day_1.SetStyle(Curve.SHORT_DASH);
close_day_1.SetDefaultColor(Color.CYAN);
AddChartBubble(mon == month and mon[-1] == month + 1, open_day_1, open_day_1, Color.CYAN, if close_day_1 <= open_day_1 then yes else no);
AddChartBubble(mon_day_1, open_day_1, "open_day_1" , Color.CYAN, if close_day_1 <= open_day_1 then yes else no);
AddChartBubble(mon == month and mon[-1] == month + 1, close_day_1, close_day_1, Color.CYAN, if close_day_1 >= open_day_1 then yes else no);
AddChartBubble(mon_day_1, close_day_1, "close_day_1" , Color.CYAN, if close_day_1 >= open_day_1 then yes else no);
#