#Chris' All in One Labels
#################################################
# Heads Up Display
#################################################
# ***************** Define *************************
def LastPrice = close(PriceType = "LAST");
def Daily = close(Period = "day");
#def RSI = reference RSI(length = 14, price = close(period = "day" )).RSI;
#def VWAP = vwap(Period = "day");
def EMA8Day = ExpAverage(Daily, 8);
def EMA13Day = ExpAverage(Daily, 13);
def EMA21Day = ExpAverage(Daily, 21);
def EMA65Day = ExpAverage(Daily, 65);
def SMA50Day = Average(Daily, 50);
#def SMA100Day = Average(Daily, 100);
def SMA200Day = Average(Daily, 200);
#def SMA50Day1 = SMA50Day >= Average(Daily, 200);
#def SMA200Day1 = SMA50Day < Average(Daily, 200);
#def DailyVol = volume(period = "day");
#def AvgVol = (volume(period = ”DAY”)[1] + volume(period = ”DAY”)[2] + volume(period = ”DAY”)[3] + volume(period = ”DAY”)[4] + volume(period = ”DAY”)[5] + volume(period = ”DAY”)[6] + volume(period = ”DAY”)[7] + volume(period = ”DAY”)[8] + volume(period = ”DAY”)[9] + volume(period = ”DAY”)[10]) / 10;
###Earnings Data
def LastEarningsBar = AbsValue(GetEventOffset(Events.EARNINGS, 0));
def NextEarnings = if IsNaN(LastEarningsBar) then 0 else LastEarningsBar;
def ERlength = 30;
def earnings = HasEarnings();
def before = HasEarnings(type = EarningTime.BEFORE_MARKET);
def after = HasEarnings(type = EarningTime.AFTER_MARKET);
def anytime = HasEarnings();
def before1 = Sum(before, ERlength)[-ERlength + 1] > 0;
def after1 = Sum(after, ERlength)[-ERlength + 1] > 0;
def anytime1 = Sum(anytime, ERlength)[-ERlength + 1] > 0;
# ***************** Labels *************************
input Show_Label_Box = yes;
#AddLabel(Show_Label_Box, "Volume: " + DailyVol, if DailyVol > AvgVol then Color.GREEN else Color.GRAY);
AddLabel(Show_Label_Box, "ER < " + NextEarnings + " Days " + if before1 then "BMO" else if after1 then "AMC" else if anytime1 then "Unknown time" else "No", Color.light_gray);
#AddLabel(Show_Label_Box, "RSI: " + Round(RSI, 2), if RSI > 70 then Color.RED else if RSI < 30 then Color.GREEN else Color.YELLOW);
#AddLabel(Show_Label_Box, "Last: " + LastPrice, Color.WHITE);#was "PM/AH: " + LastPrice, color.gray
#AddLabel(Show_Label_Box, "VWAP: " + Round(VWAP, 2), if Daily > VWAP then Color.Cyan else Color.Magenta);
#AddLabel(Show_Label_Box, "Golden Cross", if SMA50Day1 then Color.GREEN else Color.RED);
AddLabel(Show_Label_Box, "8EMA: " + Round(EMA8Day, 1), if close > EMA13Day then color.cyan else Color.Magenta);
AddLabel(Show_Label_Box, "13EMA: " + Round(EMA13Day, 1), if close > EMA13Day then color.cyan else Color.Magenta);
AddLabel(Show_Label_Box, "21EMA: " + Round(EMA21Day, 1), if close > EMA21Day then color.cyan else Color.Magenta);
#AddLabel(Show_Label_Box, "65EMA: " + Round(EMA65Day, 1), if close > EMA65Day then color.cyan else Color.Magenta);
AddLabel(Show_Label_Box, "50SMA: " + Round(SMA50Day, 1), if close > SMA50Day then color.cyan else Color.Magenta);
#AddLabel(Show_Label_Box, "Daily 100sma: " + Round(SMA100Day, 2), if close > SMA100Day then color.blue else Color.RED);
AddLabel(Show_Label_Box, "200SMA: " + Round(SMA200Day, 1), if close > SMA200Day then color.cyan else Color.Magenta);#was color.green,red
#End Code