I, Robot

It's been a week since my last post yet it only seems like yesterday. I've been a little bit out of action this week as far as blogging is concerned as I needed to get my accounts sorted and my tax return sent off. A tedious task at the best of times, though I'm my own worst enemy in that over the years I've tended to collate my accounts annually rather than keeping them up-to-date as I go.

That's it done now so I can get back to more important things.

I've still been trading, though I'm finding the past week or so very difficult and it is only through the lay system that I'm in profit for the month. Currently sitting at 38 points after 10 days, I'm delighted the way this is going. So much so that it may be time to up my stakes a bit.

The dobbing treble is in profit, though I'm not doing as many of those as I originally hoped. So far I've had one successful attempt, one scratched and two failures. The three runners that have failed to dob should never have been picks. The failure was mine in that I allowed boredom and frustration take hold and put money on picks in hope rather than judgement. Never a good plan.

With the continued success of the lays, it is time I started looking at setting up a bot to automate these. Thanks to Steve (you know who you are - actually, loads of you know him by another name, but I won't give his secret away), has been continually prodding me to get my finger out and get coding. So thanks must go to him.

Although I've written quite a few programs, predominately using VBA, in its various guises, as well as other flavours of Basic, I've never thought of myself anything like a good programmer. I find it quite boring to be honest. Still needs must...

As I'm a Linux only kind of guy, the obvious thing for me to use is a web based bot structured around a mySQL database with PHP scripting. I'm new to both of these things though I've been meaning to get up to speed for ages, purely from a professional standpoint. I've never really had a decent project to inspire me to get off my backside and do it. Until now that is.

There's two main steps involved in this project...

Firstly, I need to automate the analysis process that currently takes me 30-60 mins every night. It is from this process that the lay selections are made so cutting this down to one or two clicks of a mouse button will be of huge benefit.

Secondly, once the analysis is sorted, I then need to get up to speed with connecting to Betfair's free API so that the bot can place bets for me. That's another thing I've never done before, but there's loads of PHP help on the Betfair developer forum so hopefully that won't be too arduous.

My plan for the analysis requirement is this...

It will automatically download the latest data file from the Betfair website, modify it as required prior to loading it directly into the mySQL database, retrieve a list of the runners for that day from the Betfair site and use the database to retrieve their histories, analyse the results and chuck out the selections for the day which I'll use to manually place the bets.

I'm hoping that that will be up and running by the end of this week after which I'll use it in parallel with doing it manually just to make sure that it is pulling in the data I want it to pull in. In the meantime, I'll start reading up on how to program the bot to connect to the API.

So that's what I'll be doing to while away the hours as the nights get longer. Hopefully it won't take me too long before it is up and running.

No comments: