Earnings reported between two dates in the past


Category:
0
0

Hi Pete,

How do I scan for earnings between two specific dates? Ex: 10/15/19 thru 10/31/19

Thanks again!

Marked as spam
Posted by (Questions: 20, Answers: 27)
Asked on November 4, 2019 12:01 pm
124 views
0
Private answer

Please use the search function before posting a new question in the Q&A forum. Your question has already been posted and answered.

https://www.hahn-tech.com/ans/scan-for-earnings-between-30-and-38-days/

Edit: After getting some more details on this I have the following solution. This solution is to scan for stocks that have already reported earnings between two dates in the past. The solution I linked to in my original answer above only searched for earnings being reported at some future date.

input earningsStart = 20191015;
input earningsEnd = 20191031;
def daysFromStart = DaysFromDate(earningsStart) >= 0;
def daysFromEnd = DaysFromDate(earningsEnd) <= 0;
def targetPeriod = daysFromStart and daysFromEnd;
rec trackEarnings = if targetPeriod and HasEarnings() then 1 else trackEarnings[1];
plot scan = trackEarnings;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on November 4, 2019 4:54 pm
0
Sorry for not explaining better what I'm looking for. I saw your above solution but this requires a manual change daily to the input. Is there a way to include the actual start date such as 10/15/19 to make the scan static?
( at November 5, 2019 12:04 am)
0
Ok, I misunderstood. So you want to scan for stocks that have reported earnings in the past, between two specified dates. Is that correct? Most of the other solutions on the forum are for stocks that are reporting earnings a specified number of days in the future. We need to make sure we clarify this for the rest of our viewers. I may update the question title to reflect this.
( at November 5, 2019 9:08 am)
0
Correct on between two past specified dates.
( at November 5, 2019 9:53 am)
0
I have updated my answer to provide the solution you requested.
( at November 5, 2019 4:33 pm)
0
Thank you so much again Pete! This is what I'm looking for!
( at November 5, 2019 10:40 pm)