The P/E ratio is defined as the price of the stock divided by the earnings per share of the stock, and is particularly interesting because it's dimensionless (has no units) and has historically always remained around the same value.
This algorithm computes the P/E ratio every day using the current S&P price and most recent S&P earnings per share. If the current P/E ratio is higher than its historical average, then we would expect the stock price to go down, so we short. If the current P/E ratio is lower than its historical average, then we would expect the stock price to go up, so we go long.
The earnings look pretty crazy because at least in these backtests, this is a good predictor of days the S&P crashes. It often goes long periods of time without trading, so it may be best to pair this with another signal or strategy.
Clone the algo and play around with it, and let me know if you have any questions!
EDIT: Simon has pointed out below that this would not be realistic for live trading, since I didn't account for earning announcement delay. I still believe this idea has merit, however, due to the nature of the ratio.