The more appropriate analogy is that trading stocks is like gambling. And it's not even analogy. Unless you really know what you're doing, trading stocks is gambling, just with less house edge.
Professional trading, esp with leverage, is extraordinarily difficult to gain the required mentality, discipline, knowledge, and skills be consistently profitable. The common saying is that 90% fail, I believe it's higher, perhaps much higher. Learning trading was the most difficult thing I've done in my life. It's hard in a way most people don't grasp.
Yes, I'm talking about speculating though the difference is basically just in the holding duration of your stocks. If you're trading every day, that's speculation. If you buy and hold for 10 years, that's investing.