Betfair Bot: Environment/Setup

Hi folks,

here is the first blog post of the series “Creating A Betfair Bot With C#”.

This section will give some information about the environment and setup of our work. This section is not a tutorial about using the presented tools, because there are also other tools available and giving a complete overview of all developer tools would cost too much time.

Hardware Environment:
There is no special hardware required. Make sure you are using a computer with Microsoft Windows. I started working on the bots under Windows XP and now I am working under Windows 7.

Software Environment:
I am working with Microsoft Visual Studio Professional 2005. vs_screenshot I am sorry, but my version of Visual Studio is in German and I can not change the language so far. If there are any questions feel free to ask.

Visual Studio is not only a code editor. It has also a forms designer which let you create windows user interfaces via drag and drop, which saves you a lot of time.

An alternative for Visual Studio might be Microsoft Visual Studio Express. I must admit I do not have any experiences with VS Express, but I am sure there are many tutorials out there about this tool.

You also need to have Microsoft .NET Framework installed on those computers you are running your bot. When installing Visual Studio I think the framework is installed too. But if you want to run your bot on another machine, maybe a Virtual Private Server, make sure that the framework is installed. To download the framework just visit Google and enter “.NET Framework”. You will get a lot of results for downloading. It is free to use.

Generally my bots are using local databases. Therefore I am using Microsoft SQL Server Compact 3.5. This is an embedded database, which means you will have a single database file with file extension SDF. You can use this database like a common and well known database like Oracle or MySQL. The advantage is you do not need to care about database management handling like table spaces and user privileges etc. You just need to create your database tables and save your data.
It is really easy to use. You can save your matched bets and prices of single selections for tracking etc.
I am using the database for saving matched selections, so I can start and stop my bot without losing data, because they are stored in my local database. If those data are only available in memory in variables an objects I would lose them if my bot crashes or if I would stop the bot. It is not required, but it is really helpful.

When using Microsoft SQL Server Compact 3.5 you need to be able to have a look at your SDF files. I am doing this via SDF-Viewer. You can also use Visual Studio for that, but for me it is much more comfortable to use SDF-Viewer.

Today’s section did not help much about getting really in touch with Betfair, but I think it is necessary to give an overview which tools I am using. If there is anybody also working on betting bots feel free to add your thoughts and comments about the tools I am using and also about the tools you are using which are not mentioned in this blog post.

The next section “Basic Functionality” will handle all the stuff I am using for logging, data management (database), settings and bot handling. We will also see how I am organising my bot projects, which will help us to use the same source code easily in another bot again without recoding the same stuff again and again. At the end of the next section we will have our first self created software. We will be able to start and stop the bot, create logging entries, we will use registry settings and we will get in touch with threading and event handling.

That’s it so far.
If there are any comments or questions feel free to drop an email or leave a comment.

Cheers, Loocie


Anonymous said...

I will be folloing this tutorial as i am interested in creating a betting bot.I have no programming experience but am looking into Visual C# express as it is supposed to be easier for beginners

Funaki said...

Super Blog. Ich freu mich schon auf die Reihe. Kannst du ein deutsches Buch für den Einstieg in C# empfehlen? Alles was ich bisher gesehen habe, schreckt mich ab.

Gruß und noch viel Erfolg und Spaß bei deinen Projekten.

Loocie said...

Hi Anonymous,

thanks for dropping by. I hope you can get something out of it. If there will be any questions feel free to ask.

All the best!

Cheers, Loocie

Loocie said...

Hallo Funaki,

schön auch mal was von deutschen Lesern/Tradern und Wett-Begeisterten zu lesen. Ein gutes deutsches Buch ist Open Galileo.
Ich habe das Buch anfangs oft zum Nachschlagen benutzt.
Generell empfehle ich immer sich Aufgaben zu stellen, um eine Programmiersprache zu lernen, z.b. einen Taschenrechner zu programmieren, etc. Dadurch hat man ein klares Ziel und weiß wo man hin will.
Wenn du Fragen hast, melde dich einfach, vielleicht kann ich dir helfen.

Beste Grüße,


Cran said...

Visual Studio 2010 Express is almost as good as the Pro version for a single developer as far as I can tell.

It uses .Net 4 and so far I haven't found anything I've wanted to do in C# that I can't do with the Express version.

Loocie said...

Hi Cran,

Sorry for my delayed reply.
Does Visual Studio 2010 Express also contains the Form Designer or do you need to write all the code for the controls yourself?

Cheers, Loocie