Of course if you're loosing and you think that your money isn't growing but decreasing learn to stop playing and take some rest. So that even a little amount of money will be left to you. Don't push yourself and don be greedy in that situation. Be smart in playing and of course sportsmanship.
Frankly, it doesn't need to be smart to stop gambling just in time. All we need is to get used to always setting the upper and lower limits to exit the game.
include a situation where actually you should leave immediately no matter what instead continue playing. experience sometimes makes you looks like a smart person , it is not . but you have know already what kind action you should do on certain situation.