Please see your triggers attached. Use the newly added two constants to adjust the ratio of the liabilities of the two bets and the percentage by which the price of the second bet should be less than SP.
Please note that once one of the bets has lost, in the next race the first bet will absorb all the loss and the liability of the second bet will be calculated based on the percentage of the current bank, without taking into account the loss.
Make sure you've tested the triggers in Test Mode.