Indeed, not all gambling is luck-based, there are also skill-based ones that can also be influenced by how our skills and abilities are in analyzing betting. especially in skill-based games, predicting match wins, and others. It's just that, luck will always be there, but that doesn't mean in this case it's pure 100% luck always and only.
It's just that, if the trading is done without any analysis and thorough preparation, then it will only be detrimental, unless it's because of luck. because of that, trading is often associated with gambling, when the traders are especially new people who do trading, especially future trading with elevation, but don't do analysis or other preparations. so, it could be relying on luck. it might be similar to gambling based on luck.
You are right, however, gambling still involves luck, including as you said in skill-based gambling also requires luck, it's just that the skills we have can increase our chances of winning when gambling, besides that, don't be too confident with the skills we have because there is no clear certainty about winning.
But in my opinion, there are also people who trade by relying only on luck, hoping that the transactions they make can generate profits while they have no skills or knowledge at all about trading, or their minimal knowledge so they only rely on luck, this is ridiculous.