This algorithm uses a random forest classifier with a threshold for how much the price moved (e.g. only consider y = True if the price moved up or down x%). It appears to smooth out SPY a bit, but clearly not a successful strategy. I think what would help is to look at a portfolio of stocks and use a higher threshold (currently using 25bps). For example, scanning a portfolio of 100 stocks for those that meet > or < 2%, but this would be require significantly more processing power.