Earnings label for days to earnings


How can I get an Earnings label for days to earnings on chart?

Marked as spam
Posted by (Questions: 3, Answers: 3)
Asked on October 15, 2020 3:20 pm
Private answer

I'm sure you searched for this solution before posting. But we have already solved this in the Watchlist topic. I believe the Watchlist solution is far more useful than having this displayed on a chart. But if you really think a chart label is more useful then reply back in the comments section below and I'll provide the solution here.

Edit: The solution for the watchlist column does not work for a chart study label.

I tested this on a chart and it requires the right-side "Expansion Area" is set to include the date in which the next earnings event is scheduled to occur. (I know, sort of defeats the purpose). The example I used was AAPL. On the watchlist version this shows a value of -9. Which indicates the next earnings is 9 trading sessions in the future. When we apply this to a chart with Expansion Area set to zero the label displays a value of zero. When you set the Expansion Area to 10 the labels displays a value of -9.

Just in case anyone can still use it under these conditions I will provide the code to add that label to your chart.

AddLabel(yes, Concat("Days Till Earnings: ", GetEventOffset(Events.EARNINGS, 1)), Color.WHITE);

For reference, here is a link to the post to do this in a watchlist column:


Marked as spam
Posted by (Questions: 37, Answers: 3291)
Answered on October 15, 2020 6:38 pm
I make my trading decisions using the charts. My many Watchlist already have 7 columns and I don't want it to take up more width on the screen. I generally do a scan and go straight to the chart. I have several Watchlist and scans so I would have to find the right list to check the stock. So for me having an Earnings Number of days label would be a time saver. I did try to try and code the label, but I could figure out how to get the data.
( at October 16, 2020 9:25 am)
I have updated my answer to include the solution you requested. However it does not work the same way it does in the watchlist column and I have described that in detail along with the solution.
( at October 16, 2020 12:24 pm)
To clarify, the Earning Label will only show if the Chart / Style / Settings / Time Axis / Expansion area: ## bars to the right is set large enough to include the the days of the Earning call. This means you will have that many empty spaces on the Right side of your bars or candles. If you want to see 30 days ahead you will have 30 empty spaces for that time interval (days, hours, etc). And my Thanks to Pete Hahn - made a donation about a month ago $20
( at October 17, 2020 9:52 am)
You understand things perfectly, yes. And thanks so much for your generous voluntary contribution. (we don't call it a donation because Hahn-Tech is a for-profit business).
( at October 17, 2020 4:31 pm)