Hi,
I am having some difficulties developing a trigger for horse betting. The trigger places both a back and a lay bets at the same time separated by 3 ticks. Basically it places bets in all the horses which odds are below a certain number (e.g. 15).
I am letting the unmatched bets in the market till it goes to inplay. However,when the unmatched bets have a difference to the respective back or lay market´s price equal or bigger than a certain number of ticks ( e.g. 5 ticks), i would like to cancel them and place anothers with 1/2 of that difference in ticks.
Explaining better lets imagine that i´ve placed bets in different horses (both lay and back bets in each one), when the market´s time before the off arrives to zero, i still have 2 lay bets and 2 back bets:
Back bets odds
Unmatched market´s price ticks dif. new ticks dif. new bet
horse 1: 3.5 2.96 12 12/2=6 2.96+6 ticks=3.2
horse 2: 12 13.5 3 as <5 not canceled/placed
Lay bets odds
Unmatched market´s price ticks dif. new ticks dif. new bet
horse 3: 7.6 8.6 5 5/2=2.5(+-3) 7.6+3 ticks=8.2
horse 4: 11 13 4 as <5 not canceled/placed
In this case horses 2 and 4 would have their bets untouched to be matched inplay.
In opposite bets in horses 1 and 3 should be cancelled and new ones placed.
I am not sure if it´s possible to round the ticks diference (e.g 2.5 to 3) as it is made in excel.
I would be grateful if someone could help me.
Thanks,