Having looked at this in more detail, what I need to do is prevent further bets after a loss, until another winner appears.
Finding the next winner is the tricky bit because I need to identify that the bet was a winner, even if xfeeder didn't bet on it!
This is quite a valuable setting to check, because typically both the big gains and big losses are made on runs and the rest of the action is just "noise". Stopping betting on losing runs before they start draining the bank is crucial and I'm surprised that I can't find an easy way (or even hard!) way to do this.