Up And Running

At last, I have got the code in place to automatically analyse the current day's races and pick out the potential lay bet selections.

Since I started looking at this back in May, I've been manually trolling through the card using information from the PatternForm and Timeform sites in order to make my picks. This would typically take around 60 mins, but during the hectic summer months could easily be over 2 hrs simply due to the number of races and horses involved. Doing it manually would inevitably lead to mistakes as well so automating the process is long over due.

I had initially looked at a combination of web scraping and accessing the free API provided by Betfair. After spending a few days reading through the API documentation, I decided to concentrate on that. After all, I would need to use the API if I ever wanted to place bets automatically so it seemed the sensible thing to head down the API route from the outset.

I needed to spend a bit of time just getting my head around some of the basics. I cannot be described as a programmer, not by any stretch of the imagination - despite having a Post Graduate Diploma in Software Engineering! All that did was convince me I didn't want to be a programmer :), but I digress...

So I know the basics in terms of how to go about things, but I've never used PHP before so that was a new language for me, as well as the learning about the API. Never done anything like that either. Much of it was helped by using the PHP BetfaiAPIFramework freely available from the Betfair developer forum. Having said that, the documentation is poor, so it took a few days pouring over the code to figure out what it was doing.

Web based and hosted on an Apache2 web server, it uses PHP to pull in all the Betfair historic data files for the win markets and stick them in a database in MySQL. It then fetches all the UK race information for the day via the API using functions in the BetfairAPIFramework, analyses that with the database, and then spits out the selections based on predefined selection criteria - saving me a ridiculous amount of effort in the process.

I can now spend that time looking at other things with the ultimate aim of automating the bet process, assuming the systems and strategies I develop are profitable of course.


Mark Iverson said...

Sounds exciting mate. If the good lay results continue, this could be a majestic milestone for you.

Good luck as always.


PhilipH said...

This sounds very exciting Ali. I too was once a so-called analyst/programmer for HM Customs and Excise, working with three rooms-ful of old ICL mainframes, punched card operators feeding my code into the system! The average mobile phone now has 100 times the power of those ICL machines! COBOL was the language. Cobblers to many! I enjoyed my couple of years doing this but doubt if I could manage even basic html, or suchlike, nowadays!
How would one get the list of lay bets that your skills now come up with? Or is that all top secret?

crotig said...

Congrats Alistair. A goal for many to automate the whole process as it can be very tedious and time consuming regardless of market and strategy.

LOL Philip. I remember having to learn COBOL when doing my Bsc in Computing in '94. Even though they told us it was dead and we would never code anyhting new in it we would have to know it to patch all the old systems that would use it for ages to come.

Alistair said...

Thanks for the comments guys. The automation of the analysis/preliminary selection process is certainly going to make a difference in terms of my family life. Or it should, though I'll probably still spend the extra time parked in front of the computer :)

I don't know if 'majestic milestone' is the way I'd describe it Mark. As with any lay system, a sizeable bank is required in order to absorb the inevitable draw downs. All of which means I won't be giving up the day job just yet.

As for the selections themselves Phil, they'll remain a closely guarded secret. I don't intend to make them generally available. Certainly not until I'm satisfied that the picks are both profitable over the longer term and their release won't damage the returns. Something I've yet to be convinced of.

Thanks again for popping by.

Alistair said...

Thanks crotig. Having sorted that out, I've now got ideas popping into my end every few minutes. I have the suspicion that the time I've saved won't be enough.

COBOL is something I've never come across. Having done a degree in Electrical and Electronic Engineer in the early 80s it was Fortran and Pascal that I had to learn. I absolutely hated it. Indeed, I hated all the computer and logic stuff we covered, vowing never to go near a computer again. This was before PCs hit the scene big time of course. Little did I know where I'd end up.

Life has a habit of making fools of us all.