Found this indicator created by Mobius while I was browsing the thinkScript Lounge. It adds two labels to your chart. One shows the next earning date for the stock. If the upcoming earning date is within five days, it will also add a bright red warning. It sort of acts as an attention grabber to let you know.
Warning: Some users have pointed out that this indicator and the data it provides may be inconsistent. An alternative script has been posted here.
thinkScript Code
Code:
# Next Earnings Label
# Mobius
def Earnings = AbsValue(GetEventOffset(Events.Earnings, 0));
def NextEarnings = if isNaN(Earnings)
then 0
else Earnings;
def Month = getMonth();
def year = getYear();
def DOW = getDayOfWeek(getYYYYMMDD());
def today = getDayOfMonth(getYYYYMMDD());
def EarningDay = if NextEarnings + DOW <= 5
then NextEarnings + today
else if NextEarnings + DOw > 5
then NextEarnings + today + 2
else NextEarnings;
AddLabel(1, "Next " + getSymbol() + " earnings " + Month + "/" + EarningDay + "/" + AsPrice(year), color.white);
AddLabel(NextEarnings < 30 and NextEarnings > 0,
"Earnings in " + NextEarnings +
" trading days", if NextEarnings <= 4
then Color.Red
else Color.White);
Shareable Link
https://tos.mx/FDrNKRWarning: Some users have pointed out that this indicator and the data it provides may be inconsistent. An alternative script has been posted here.
Attachments
Last edited: