WeeksToQ

It recently came to my attention that WeeksToQ is forward-looking when used in backtests. It looks forward to the next announcement and then counts back. So it introduces lookahead bias. There's no precise substitute, but I figured out a formula that comes relatively close for companies that report quarterly: Max(13-WeeksIntoQ,Max(0,(365-(FHist("$dayssinceannouncement",44)+7*44))/7-1)) where $dayssinceannouncement is Min (LatestActualDays, DaysSince (Max (LatestFilingDate, LatestNewsDate))). I hope this is useful for someone, and of course I'd welcome suggestions for improvement.

6 Likes

How does the weeks to quarter factor work live? Does it look at the announced date or does it simply not work live? Is latest news date used for both announcements and results?

WeeksToQ works live. It estimates the number of weeks until a company's next earnings release by taking the prior year's announcement date for the same quarter and adding one year.

LatestNewsDate is defined as the date the latest period announced by the company via a press release.

2 Likes

Thanks Walter. Does the historical work the same as the live one? Or is the historical the actual date? If it is done this way (using past data available PIT) why is there look ahead bias if its just 'extrapolating' a past date PIT?

Latest news date then is just used for the expected official earnings release dates or is it the date the release is announced? Put another way, is it the earnings day or the day the earnings date is set?

This is the description currently:

Latest (Any Source)
The earliest date of either the press release from the company or the date any data appears in the database

Does not really specify which press release. mergers? earnings? bankrupcy? etc just earnings?

In the cases I've seen, LatestNewsDate is the date of the publicly released earnings. Try this in the screener;

@Bars:BarsSince(LatestNewsDate)

In practical terms, this is the date a company publicly announced its financial results through a press release (typically an earnings announcement) and it should match other sources that report earnings events.

1 Like

hmmm so the earnings date. Ok thanks. just earnings or any press release?

My understanding is this is just earnings.

Hmm looks like for simulations it is different than for live. Live is PIT. Historical looks ahead based on this note: "Historically the function is more accurate. When you run a simulation these functions are calculated at a Point In Time (PIT) by looking for the earnings report that was announced with a date greater than the PIT date. We then take the difference of these two dates and return the number of weeks."

1 Like

I think that was Yuval's original point.

1 Like

Yes it is just odd to do it differently live than historically, but still a good field for testing other things. I have not used it yet

1 Like

Will try it out-thanks for sharing

1 Like