Laying On the Favourite And Second Favourite In Place Markets, If The Sum Of Their Prices Is <=3.8
Lay £2 on the favourite and second favourite in a place market, if the sum of their odds does not exceed 3.8. Place the bets at 1 minute before the off, provided there are 10 or more runners.
The first two conditions of the trigger sort out the first two favourites. The first condition might have been enough, but the second condition prevents picking three or more selections in case when they have the same odds. The variable sel_order returns the order of the selection by its price (1 standing for the favourite, 2 - for the second favourite and so on). Then comes the condition that adds up the prices of the first two favourites, and checks if the sum satisfies the criteria. The last two conditions make sure that the trigger is executed at 1 minute before the off, and only in markets with 10+ runners.