Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
AddVerticalLine(showLines and HasEarnings(), "Earnings!", GlobalColor("Earnings Release Date" ), Curve.FIRM);
def before = Sum(HasEarnings(), daysBefore)[-daysBefore];
def after = Sum(HasEarnings(), daysAfter)[1];
def value1 = HighestAll(high);
def value2 = if paintBackground and before then LowestAll(low) else Double.NaN;
def value3 = if paintBackground and after then LowestAll(low) else Double.NaN;
Thank thats great, I like what you did there, but im looking for a way to put the physical date on the chart.
For instance if im looking at a daily chart and dont have the Right Expansion on, I want a small box in the upper left corner that lists the next earnings date.
It never ceases to amaze me the outpouring of generosity here in the forum. Thank you for contributing this study optiontrader101! I have a real problem remembering to check earnings dates before entering a swing trade. This will definitely help!
Hi, I'm trying to write a code that calculates the average range in earnings of 52 weeks. However, I encounter issues and I can't seem to write it out due to my lack of knowledge in Thinkscript.
I get stuck on finding the range of the previous earnings, I think it has got to do with defining the date of the earnings. Below is the code that's as far as I get.
Kindly appreciate if anyone is able to help out thanks for reading
Cheers
#====================================================
def ear= HasEarnings(EarningTime.BEFORE_MARKET)[1];
def countdown = if ear then getyyYYMMDD() - getyYYYMMDD() else double.nan;
def a = if ear then getyyyymmdd() else double.nan;
def hod = if a then high(period = aggregationperiod.day) else double.nan;
def lod = if a then low(period = aggregationperiod.day) else double.nan;
def range = if a then hod-lod else double.nan;
AddLabel(yes, "range" + range, Color.white);
#====================================================
I tested this script on DOCU and a few other tickers, and it gives an erroneous date (shows 8/34/2020 as next earnings). Any idea how to correct it? Thank you.