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.
Speculative trading is not investing.
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.