Backing on Under 2.5 Goals
After 20 minutes of the market going in-play, back on "Under 2.5 Goals". Green it up 20 minutes later (if possible). If a goal was scored and no greening-up took place, distribute the loss equally.
The block contains three triggers - one per each betting action. The first trigger backs on a selection whose name contains the words "Under 2.5 Goals" (this can be any Soccer match).
The second trigger is a greening-up one. Its conditions find the selection that has a matched back bet, and check if 20 or more minutes have passed since the back bet was placed. One of the conditions utilizes the newly added variable bm_backtime, which returns the time at which the last back matched bet was placed. The variable is of the "date/time" type, so in order to convert it into minutes we need to make a little conversion. By dividing the difference between now and the time that bet was placed by 0.000694, we'll get this time in minutes.
The third trigger will distribute the loss in case a goal was scored. It makes this decision based on the difference between the time at which a market turned in-play, and the time it was last suspended. Obviously, if it was suspended after the market turned in-play, this means that a goal was scored. The formula 1+(now_time - event_off)/0.000694 returns the time that passed since the actual start of the match plus one minute.