By and large, the horse selection rules tell the software WHAT you want to trade, and the betting rules tell it HOW you want to trade those selections.
Currently, the way we handle our automation integration is to generate a qualifiers list based on the horse selection rules and publish those, for you to import into the bot software of your choice.
So basically, we create a list of potential qualifiers based on the fundamentals of your strategy, and you then recreate the betting rules in your bot software, as it's not currently feasible for us to be updating your qualifiers list 5 times per second every time the prices change and then sending those updates to various different bot softwares! Dedicated trading software is much better placed to track price changes and choose whether or not to place the trades based on those price conditions.
This means people need to faithfully recreate their betting rules from our software in BFBM, to ensure their strategy behaves the way it did in the backtesting scenarios created in our software.
We had several months of discussion with users regarding differences between the backtesting simulation and the trades they were actually placing in their bots. People understandably wanted the backtesting to match the trades they were actually placing, otherwise how could they trust that the backtesting was accurate?
We made some big changes to the betting rules based on this work and I believe the difference margin between the simulations and live trading is now negligible. This is excellent, because if you think about it, the backtesting is only telling you which prices were hit at different times in the life of the market at a general level, i.e. "SOMEONE got this price at this time". That doesn't necessarily guarantee that YOU will achieve that price.
Imagine if Apple had a sale on iPad Pros and offered 10 units for half price (admittedly a ridiculous scenario, but I like to dream 😆). Persons 10 and 11 could both be in the same queue at the same time trying to buy one, but once the 10th is sold, person 11 is going to be paying full whack or changing their mind. It's still true to say SOMEONE was able to buy at that better price.
It's the same way with backtesting. We can only tell you the facts of what happened in the market at the time, with the caveat that it may not be you getting those prices in real life. So I'm very pleased that it's proving to be so accurate.
All that preamble brings me to some of the reasons why I was keen to work on a bot of our own design with Ryan. It gives us a good opportunity to explore tighter ways of integrating our software with 3rd party trading software:
Maybe we can create some formatters for the betting rules that automatically convert them to the right format for BFBM, so people don't have the job of replicating that information
Maybe we can have a more "live" link where the trading software pulls directly from our API when it knows it's time to place trades
We can test the accuracy of the backtesting algorithm ourselves in endless situations
Additionally, because my own trading has been fully automated for many years now, this gave us some other opportunities. I created Ryan's bot using the same framework as my own and loaded the same strategies into it. You'd expect them both to place the same trades at the same time, but would they...?
Well for starters, because Ryan's only just started using Betfair's API, we started testing using the free "delayed" API key provided by Betfair. The limitation with this is that there's a random delay to price updates of between (I think) 10 and 180 seconds. We were interested in seeing whether this would be viable to use for anyone just starting out developing their own bots. If it was possible to at least make a bit of money using the delayed key, at least that would pay for the live key (currently a one-off cost of £300, paid to Betfair) and that reduces the barrier to entry for any budding Betfair developers.
In short (and probably as expected), it's not really viable at all. Pre-race set and forget stuff where the bets are placed a while before the race were fine, as the prices aren't changing too much too often. But the closer you get to the race, the more "busy" the prices get and before you know it, your bots is placing bets based on prices from 3 minutes ago.
The differences between the bets placed by my bot on the live key and his on the delayed one were comical. Any strategy involving an exit was out, obviously especially in-play.
So unfortunately, if you're looking to create your own bots for Betfair, you need to spring for the live API key pretty early on and hope that you make the cost back. Once Ryan's live API key is sorted, we'll carry on and share the results. In the meantime, I'm playing with some different ways of integrating the BTC horse racing software with my end of the bot, to try and find the optimal way of keeping qualifiers up to date on both sides.
One of the challenges we have is that to provide quick access to each person's daily qualifiers, we have to basically run everyone's active strategies in the background constantly and update the qualifiers lists. Currently this happens once every half hour or so, but it would be nice if 3rd party software could say "hey, give me the bang-up-to-date qualifiers list for Ryan's strategy, and run this on demand". So that's how our bot is currently set up, so we can find a viable way of making that work for hundreds of requests in parallel.
I'll stop the storytime there. Consider yourself a hero if you've got to this point!
Some quick Q&A based on emails we've had so far:
How do I get a live API key for Betfair?
Unless you're literally coding your own Betfair apps from scratch, you don't need one. If you're using commercially available software like BetAngel and BFBM you already effectively get a license to use the live API through that. If you ARE looking to create your own bots from scratch though, here's how to get started
Is your bot publicly available?
No. We don't currently have any plans to release any commercial trading / bet placement software. For now, we're focusing on helping you find the opportunities, rather than the execution of the trades
Happy trading
Adam