You see, I have tried this technique in the past with no fruitful results, and it is countereffective many times because once you see how much you have lost, you would want to gamble more to recover them back

that's how it all works, because you would stop for a moment or so thinking about your loss and then when the urge will come again, the same resistance will act as a fuel to further gamble xD