Skip to content

Instantly share code, notes, and snippets.

@tarnus
Created July 22, 2020 00:03
Show Gist options
  • Save tarnus/b81f62384a4326d59b5197ac80b1ab64 to your computer and use it in GitHub Desktop.
Save tarnus/b81f62384a4326d59b5197ac80b1ab64 to your computer and use it in GitHub Desktop.
Days to Earnings Column
#################
# ER Labels
#################
def daysBefore = 100;
def erInDays = AbsValue(GetEventOffset(Events.EARNINGS, 0));
def before = Sum(HasEarnings(), daysBefore)[-daysBefore];
AddLabel(Yes, IF before THEN "ER: "+erInDays+" days" ELSE "ER: No", IF before THEN Color.RED ELSE Color.GREEN);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment