Posts Tagged ‘data sources’

Well-Handicapped Horses

Saturday, September 11th, 2010

Just finished reading Jon Gibby’s (relatively) new book, Well-Handicapped Horses.  It’s to be thoroughly recommended, though anyone who’s read his previous Betting on Flat Handicaps will find it more like an update (on how best to use his methods in 2010 rather than 2002) than a new book.  He does include a couple of new chapters on betting 2 year olds and using speed ratings, however.  I won’t attempt a full review here, though a few points stand out.

Some of these points relate to the market in general and how the market is wise, or at least wiser, to many of the methods he previously advocated – in particular to draw bias.  Basically, the same biases are more or less in existence, but the runners coming from the bias-affected stalls are sent off at far shorter prices than they were a few years ago.  It’s not necessary to reproduce one of his examples from the book, since we can usually see a distinct correlation in known bias-affected tracks every day by comparing the ranking of the betting on Betfair (ie. favourite to least fancied) and the stalls positions of each.

Betwise produce these rankings every day – so, taking early prices today as an example, the current top 3 in the Betfair betting in the 5.20 at Chester (a 10 runner, 5 furlong race with a typically strong bias to low numbers) are drawn 1, 3 and 4 respectively.  In the Sandown 2.50 (a 12 runner, 5 furlong race with a typically strong bias to high numbers), the top 4 in the betting are drawn 8, 12, 2 and 10 respectively. (Incidentally, Hoh Hoh Hoh, who has run well at Sandown in the past, is drawn 11 and is out with the washing in the betting at 25/1 – backers take note).

Thus it’s harder to make a profit by following the draw alone. Gibby compensates for this by looking largely at draw anomalies (where one part of the track is favoured/ not favoured at particular meetings) as well as longer term trends.  He looks in particular to follow horses who were disadvantaged by the draw in their subsequent outings – as long as they have become well handicapped as a result.

One point that I should take issue with is when he concludes punters need to subscribe to The Racing Post and Raceform Interactive in order to spot and take advantage of these anomalies.  Fine tools though these are, there are many alternative (and sometimes better, depending on what you actually want to do) data sources available.  Not least of these is our own SmartForm, which adds the significant advantage of enabling you program directly with racing data.  Whilst programming is an obstacle for some, once you’re over it you can automate a number of derived variables (or have Betwise do it for you), such as draw bias assessments.  A type of analysis that Gibby also holds in high regard, which seems to be painstakingly manual for each race, is pace analysis.  Again, with SmartForm we can program pace bias automatically, both his method and most similar ones.  In fact, we use a slightly different method to Gibby and also calculate pace for likely laggers (ie. those horses who will break slowly) and hold up horses.  Speaking of which, free leader and lagger ratings are now up in the Betwise Members’ area for all today’s sprint races…

Comparing horses from different sources – the solution

Friday, May 7th, 2010

In yesterday’s post we discussed the problem of using information from different data sources for research and automated betting, where the name of the horse differs according to the data source.

The most common problems are incorrect capitalization within horse names (eg.  Sea the Stars instead of Sea The Stars) and omission, misplacement and other misdemeanors with apostrophes.

Various programming solutions are presented to this problem in Automatic Exchange Betting, but there is an even simpler solution where one of the information sources is the Smartform Racing Database.  Firstly, we know the runner names in Smartform are correct, so we can use this as our master source.   Secondly, Smartform uses straightforward SQL, which provides for many basic operations on character strings, such as conversion to lower case and pattern matching (so that we have access to search and replace functions).

This means that we can easily convert a horse name in Smartform to an equivalent name which has no capitals, no whitespace and no apostrophes.  If we do the same transformation on the name from the target data source, our correct name will match our incorrect name, and we can start to use information from both data sources in our betting strategy.  If we want to keep the correct name, we just select the correct name to be displayed but match the information on the transformed names.

If you’re not familiar with these functions in MySQL, you can download a copy and test this sort of functionality out easily without selecting any database, as in the queries below:

#Sea The Stars would normally be a variable in the database, so the query would not need quotations around the name.
>select lower("SEA THE STARS");

This will produce the name sea the stars.

Or use the replace functions to produce a name without white space (which also applies to apostrophes):

#The replace function takes three arguments separated by commas - the string to transform, the elements to replace, and the string to replace it with, as in:
>select replace("SEA THE STARS", ' ', '');

which produces the name SEATHESTARS

#Put the above functions together within one statement to produce a horse name that can be matched against another without issues:
>select replace("SEA THE STARS", ' ', '');

So at last we get seathestars.

If you’re unfamiliar with SQL, the syntax can take a little getting used to, but on the whole is a gentler introduction than learning a programming language – and allows you to achieve an awful lot when it comes to horseracing analysis.

Performing the same operation on the target horse name in another database table let’s us match data up between horses using a table join without leaving the database.  Returning to our original example from yesterday, this means, for example, we could match any form or forecast odds data in Smartform with any market data available in Betfair.  Of course, automatically creating an additional database table of Betfair prices does some programming, though re-usable step by step code is provided in Automatic Exchange Betting for exactly this job.

Comparing horses from different sources – the problem

Thursday, May 6th, 2010

A recurring problem in developing automated betting strategies is accounting for differences in horse names from different data sources, when in fact each source is referring to the same animal.

We discuss the logic behind betting strategies that use different sources in Automatic Exchange Betting.   In summary, an automated betting strategy may require various inputs that are only available from multiple data sources, – just as a manual betting strategy does.  For example, one data source may contain a horse’s form, another may contain current exchange or bookmaker prices for the horse, and another a news feed we want to scan for information on a specific horse before betting.

This problem isn’t just limited to programming betting robots, it also applies to basic research – for example collecting and retrieving Betfair market prices for any given horse name, when the horse name you want to fetch prices for does not come from Betfair to start with.

In fact, the Betfair case is the most frequent issue that we deal with in automatic betting.    Take a few examples from today’s racing:

Raddy ‘ell Pauline runs in the 4.30 at Chester, Mioche d’Estruval runs in the 5.25 at Newton Abbot, What’s Occurrin runs in the 6.50 at Wetherby, and Mandy’s Princess runs in the 3.55 at Chester.   These horses are listed in Betfair as Raddy ell Pauline, Mioche DEstruval, Whats Occurrin, and Mandys Princess, respectively.

Spot the problem?   In most cases, Betfair simply misses the apostrophe from horses’ names as a matter of policy.   Occasionally there are also capitalization problems, as with the Betfair rendition of Mioche d’Estruval above.

Let’s imagine that these four horses came from an automated selection list produced by Smartform (which lists all the horse names correctly, ie. as they were registered by their owners).   We now want our betting robot to use the Betfair API to retrieve prices for each horse, and if those prices meet a certain minimum, we want to bet on each horse.

Unfortunately, if we simply present the correct horse names to our betting program we will be in trouble – the Betfair API won’t recognize them.   We’ll get neither the prices we asked for, nor will we be able to bet on these horses – or do anything else with the Betfair API for these runners unless we take some action first.

Fortunately there are a number of simple  approaches to resolving this, the easiest of which can be done within Smartform without resorting to using a programming language at all – more on this tomorrow.