it's easy to confuse short term outcomes with longer term ones. even a casino is not sure if the next come out crap-roll is going to net the house a profit or a loss. they don't care. they have a positive mathematical expectancy built into their games.
a person scalping in the pit is not sure if his next buy or sell will be a winner or a loser. all he knows is that he's always offering to buy at the lower bid, sell at the higher offer all day long. there are other aspects to successful scalping, but assuming you can buy the bids, sell the offers and not let your emotions torpedo the technique (such as letting losses run away)--you too would have a positive mathematical expectancy.
as for system traders, they'll never know what their edge is as exactly as a slot machine programmer knows exactly when a payoff will hit and what fraction of the total intake it will be. (always less than the intake of course). but in an inexact way, a programmer can uncover biases he feels are robust and likely to persist into the future. there are prudent testing techniques and foolhardy ones. people at the top of their game--budgeted correctly at the onset, following their signals exactly without giving into to whims, and having tested correctly, are making prudent business decisions. that is not gambling in the strict sense most people use the phrase.