hi
here is your trigger,in the constants you can set.
Bet amount
Selections rank
Minutes from the start time to place the back bet
Minutes from the start time to place the lay bet
the trigger will place a back bet on your selected rank at your set time, then place a lay bet on the same selection for the matched amount at your set time if the lay price is lower that the back price taken and the time is your set time to minus half a minute as you requested about 2 minutes.
please use test mode until you are happy with your settings
mcbee
download the trigger below