When it comes to risk, I don't see much different between trading and gambling. Both involve risk just as you have said. I'm into sport betting, and nowadays punters can use the cashout bottom to terminate games if the games is going against them. This help to stop the betting, giving you part of your money. To me, this is somehow similar to that of stop loss from trading. Another one is the one game cut bottom, This helps when a single game spoil your accumulated game. So both trading and gambling help in managing risk but just in different way.
They both have risk just that they are minimal trading is better than gambling because gambling is risky in the sense that there is no stop loss and take profits and other leveraging that will reduce the risk of losing all your money and when you trade you will have the mindset of doing well when it comes to trading because of that mindset of taking risk and that is why people are always trying to compare the two because of its risk and anything that as to do with risk gambling is always in the best position.
Both trading and gambling they have there own people and trading have there own squad so a lot of things look different and gamblers are very greedy, and they don't want to lose money and they want to use a very small amount of money, and this are reasons why I will even prefer trading than gambling by far because of your emotions will be corrupted.