How the martingale works
Bet one unit on an even-money chance: red, black, even, odd, 1-18 or 19-36. If you lose, double the bet. When you finally win, the payout covers every loss of the cycle plus one unit, and you start again at one unit.
That is its appeal: most cycles end quickly with a small profit. With 1,000 to start, a 5 base bet and 100 spins, the tester finishes about 7 sessions out of 10 in profit.
The limit: a long losing streak and the table maximum
On a European wheel, red loses 19 times out of 37. Seven losses in a row happen in 0.94% of cycles, about once every 106 cycles. At 5 per unit, the 8th bet is 640: above a 500 table maximum, the progression stops and the cycle ends with a loss of 635.
Ten losses in a row (0.13% of cycles) cost 1,023 units and ask for 1,024 on the next bet. That is why, in the same tester settings, about 1 session in 5 runs out of money.
Is the martingale forbidden in casinos?
No casino forbids it. They limit it with the table maximum: in French casinos, even-money bets are capped at 360 times the minimum on English roulette and 1,000 times on French roulette. With a 1 unit start, that allows 9 and 10 bets in a row respectively.