scottsamesame
New member
Does anyone know of a thinkscript that will provide a label of when the next earnings date is? Ideally it would show the date and the # of days until the earnings date. TY
Does anyone know of a thinkscript that will provide a label of when the next earnings date is? Ideally it would show the date and the # of days until the earnings date. TY
Code:#Earnings_Date_DaysTill def div1 = GetEventOffset(eventType = Events.EARNINGS); def nodiv = if IsNaN(div1) then -99 else GetEventOffset(eventType = Events.EARNINGS); def div = if nodiv == 0 then 1 else 0; def divday = if div == 1 then GetYYYYMMDD() else Double.NaN; def divdate = (HighestAll(divday)); def year = RoundDown(divdate / 10000, 0); def month = RoundDown(((divdate - RoundDown(divdate, -4)) / 100), 0); def day = (divdate - (year...
Does anyone know of a thinkscript that will provide a label of when the next earnings date is? Ideally it would show the date and the # of days until the earnings date. TY
Code:#Earnings_Date_DaysTill def div1 = GetEventOffset(eventType = Events.EARNINGS); def nodiv = if IsNaN(div1) then -99 else GetEventOffset(eventType = Events.EARNINGS); def div = if nodiv == 0 then 1 else 0; def divday = if div == 1 then GetYYYYMMDD() else Double.NaN; def divdate = (HighestAll(divday)); def year = RoundDown(divdate / 10000, 0); def month = RoundDown(((divdate - RoundDown(divdate, -4)) / 100), 0); def day = (divdate - (year * 10000)) - (month * 100); AddLabel(1, "Next Earnings | Date: " + month + "/" + day + "/" + (year-2000) + " | Trading Days Till: " + absvalue(div1), color.white); input test = yes; addverticalLine(test and getyyyYMMDD()==divday, " " + asprice(divday), color.white, Curve.FIRM); ;
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
No, it won't work otherwise. If you want the future date, you obviously need to make that allowance in the time axis.Why does it need the 100 expansion area? Will it not work otherwise?
@scottsamesame If I understand the issue correctly, I did the following to fix the future earnings date issue:Why does it need the 100 expansion area? Will it not work otherwise?
Was there a way to add the label to the 1 min chart? it works fine on the daily chart but on the 1 min chart i'm getting nothingUse this on a Daily chart with an expansion set to 100 at the settings/time axis tab.
Was there a way to add the label to the 1 min chart? it works fine on the daily chart but on the 1 min chart i'm getting nothing
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.