A good learning algorithm should be able to handle noise and uncertainty in the data effectively.
When stocks are attractive, you buy them. Sure, they can go lower. I’ve bought stocks at $12 that went to $2, but then they later went to $30.