It's a trigger that basically bets on sure fire winners just before the end of the race (horses). Good hit rate but poor odds. Increasing stakes without a huge starting balance is a recipe for disaster as the trigger also seeks to recoup any previous losses + previously lost profit (It's set at a fixed profit per race). If I hit a losing streak the cumulative amount soon builds up, although it's never hit a losing streak of anymore than 3.
I'll keep tweaking it.