Write Your Own Betfair Software

In addition to trading via Betfair's website, Betfair also permits access to its servers via an API. Access to Betfair's API is free of charge but there are limits to the amount of data you can download at any one time. Betfair has replaced its old SOAP based API-6.0 with API-NG, based on JSON. My first impressions are that this is a much easier API to understand and code to. I have coded API-NG applications quite easily by myself without help from others, unlike the previous API.

Programming for Betfair, a guide to creating sports trading applications with API-NG, teaches you how to program a complete application for trading on Betfair. Also included is the building of databases for offline analysis, automated Betfair charts and discussion on advanced trading techniques. (Click here for the contents.)

Automatic Exchange Betting covers the now defunct API-6.0 but it does go into detail about the construction of an automated trading system. The book also covers using odds lines, weight of money, average prices etc with which to build trading systems.

Another book that details the construction of an automated betting system is Calculated Bets: Computers, Gambling and Mathematical Modeling to Win. Written by Professor Steven Skiena, Calculated Bets details the professor's successful modelling Jai Alai matches, developing a trading strategy using Monte Carlo methods and then implementing bet automation.

The Benefits of Writing Your Own Software

Most third-party trading software is licenced. You will have to pay a monthly fee to use the software. Obviously, that is not the case when you write your own software.

If you have an idea for a trading algorithm that cannot be implemented by current third-party trading software then asking them to add the required functionality might alert them to what your trading algorithm does. Third-party trading vendors are usually traders too. Don't give them your ideas.

During the early days of financial algorithmic trading, banks would buy trading software from other companies. Some of these companies ran logging software that would read what a trader was doing and then front-run that trader's order. That is not to say that any third-party sports trading software vendor is reading your keystrokes for data mining purposes but if you write your own software then you can be sure that your actions are not being mined.

Designing Your Trading Software

Rather than trying to code the ultimate trading platform straight away, you should first build simple single-task tools to handle repetitve tasks. You can then add your own metrics for manipulating Betfair data. After that you might want to automate betting and position tracking. Finally, you can code a bot that does all of the above whilst acting under your own trading rules. My own trading system is a hybrid, with automation of many tasks but the final decision of when to trade is with me.