Question About Speed Of Cancelling Bets

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
CallumPerry
Posts: 575
Joined: Wed Apr 19, 2017 5:12 pm
Location: Wolverhampton

Hi, me again. I'm a stickler for detail and with regards to automation, I have a question about what would happen if a cancelled bet got matched.

Say I have one single market running at 20m/s and the following set of circumstances play out:
1 - A rule places a bet
2 - A signal becomes true to cancel_all_unmatched_bets (for example, the price moves a few ticks away)
3 - At that moment, even a penny gets matched before my cancel order reaches BetFair.

Is this possible? Has anybody ever had a cancel rule fail because part/all of a bet got matched in that instance? Is there a nice simple way to get around this? Simply pestering myself for accountability of any outcome.
User avatar
Dallas
Posts: 22674
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

It can and does happen yes, if the whole bet has been taken you'll get an error message sent back from Betfair written to your log telling you;
'Unable to cancel bet - The bet has already been taken or lapsed'
or if repricing an order you'll get something like
'An error occurred while modifying price: The entire order has been rejected.

If its part been matched then whatever is left will be cancelled providing the matching process has finished before your cancel requested is processed by BF
CallumPerry
Posts: 575
Joined: Wed Apr 19, 2017 5:12 pm
Location: Wolverhampton

Thank you! Glad I thought about it now, I assume the best way to compensate is to just have another rule which checks the cancel signal is set AND the unmatched amount is >0 AND a few seconds have passed?

I'll add in some rules right now.
Post Reply

Return to “Bet Angel - Automation”