for all i know there is no way by winning when you gamble because when we gamble it is a rare fact it is your lucky day or badluck day, and so if you are lucky then it is really up to you if you want to go home or quit when you already win.
That should always be the mindset that you have when gambling because you would know when to stop or not. It's hard to take a loss if you always experience winning, not just in gambling but also in life. It is always going to be like that and the decisions that you would make would determine your path.