It is simple: when you stop believing it can 'turn' your way, you stop adding to your loser and get out. When you know that point, you can calculate how many scale ins you do and how much your total max risk can be.
If you do not 'know' the uncle point, you need to do research about that first...