Possible to backtest for companies that had price outperformance the trading day after earnings announcement?

Hi Everyone, I’m a newbie. Is it possible to write a rule that identifies companies that had outperformed the market the first day that trading was available after they announced earnings? For example, if last quarter IBM reported in the afternoon, I’d want to look at the next day and determine if the stock had price performance better than the market. If it did, it would be selected by the rule. Thanks in advance for any help. Doug

The formula for the price change between the date of the last earnings filing and the day after would be:

100*(Close(1+BarsSince(LatestFilingDate))-Close(BarsSince(LatestFilingDate)))/Close(BarsSince(LatestFilingDate))

The formula for is that greater than the market (the market being SPY) would be:

100*(Close(1+BarsSince(LatestFilingDate))-Close(BarsSince(LatestFilingDate)))/Close(BarsSince(LatestFilingDate))>100*(Close(1+BarsSince(LatestFilingDate),GetSeries("SPY"))-Close(BarsSince(LatestFilingDate),GetSeries("SPY")))/Close(BarsSince(LatestFilingDate),GetSeries("SPY"))

I apologize for offering a different opinion.

The formula needs to adjusted. You want Close(BarsSince(LatestFilingDate)-1)/Close(BarsSince(LatestFilingDate)) > BenchClose(BarsSince(LatestFilingDate)-1)/BenchClose(BarsSince(LatestFilingDate)).

Also, this doesn’t work for all stocks. The filing date is often different from the announcement date. So, for example, Close(BarsSince(LatestFilingDate)-1) gives the closing price for ADBE 6 bars after the announcement (when they filed). For ADBE you’d want to use LatestNewsDate rather than LatestFilingDate.

I haven’t been able to come up with a formula for when you should use LatestNewsDate or LatestFilingDate.

Thank you both for your responses. I appreciate the time you spent on this!

Defending my method, it’s independent of the benchmarks and will work even with stocks or ETFs that are not available as benchmarks on Portfolio123.