I'm glad to hear that rubold!
Indeed you can now switch between test and real modes based on the value of channel_trend: if it is positive, you can bet in real mode, if it is negative - in test mode.
Another good approach is reducing the size of your bets once you've found yourself on a losing streak, e.g. bet 1/4 of your normal bet. The new stakes will still make influence on the trend, so you'll determine the winning streak and change the size of the bet to the original one.