When your signal tells you that prices have gone into bullish(bearish) segment when you anticipated bearish(bullish) price movement. In that way, you can minimise your loss. If you don't have such an indicator, you better quit live trading before you blow up all your fortune and better start demo and stay there until you get one.
It’s funny, but while all traders trade to make money they rarely consider finishing the day “in the black” as an important part of their trading plan. By having a plan to finish the day with a positive result, you not only prevent overtrading but improve the odds of finishing the day with a profit as well. IMO
Dangerous ideas you have, and a mental problem. You have to accept the fact that you can't make money every day. You can't force the market to fullfil your wishful thinking. You need to find the right balance and stop trading even if you can't finish the day "in the black". You better should trade mechanical, ie. let the computer make the trading decisions and also the trading itself, because human emotions are the biggest enemy when trading.
Getting in and out of the trade depends on the experience of the trade you learn it slowly as you keep on trading.
It's not that simple. You have to learn how to trade before designing a viable model for the computer. Unfortunately that involves facing the enemy (emotions) more than you want to, and even after implementation the enemy doesn't just vanish.