Saturday, 14 March 2009

Automated betting with BetFair, Business Intelligence and Eclipse BIRT

When you place a single bet on a tennis match (market), you need to decide, which tennis player (runner) to bet on. Usually it’s based on your intelligence. By your intelligence I mean experience, knowledge, common sense, etc. When you use automated betting, then you place a lot of bets every day and the decision process becomes much more complicated. I this case you need something more than your intelligence, what you need is a Business Intelligence (BI).

Regarding to Wikipedia, Business Intelligence (BI) refers to skills, technologies, applications and practices used to help a business acquire a better understanding of its commercial context. In my betting application I use Business Intelligence for:
  • Historical data analysis – e.g. create reports/charts to show profit for sports/regions over the time.
  • Data mining – e.g. to recognize some particular situations when I win or lose.
  • Automated decision making system - based on evolutionary algorithms, e.g. eliminate wrong betting strategies during evolution process.
In this post I describe how I analyse historical data using Eclipse Business Intelligence and Reports Tools (BIRT) technology. Eclipse BIRT is an open source Java project from IBM and it’s a powerful tool, especially to create custom multi dimensional reports and charts. It provides easy to use GUI designer to create and run reports. The GUI designer can be used as a stand alone application or a plugin in Eclipse IDE. Also a web based reports viewer is provided, which in my opinion isn’t very good. Finally there is a very well documented API, that allows to integrate BIRT charts and reports into a thirt-party applications.

The examples below present BIRT chart and table report integrated into web console of my betting application.

Figure 1 Profit per week over the time.

Figure 2 Profit per sport/region over the time.

How I use Eclipse BIRT?

In my betting application BIRT reports and charts are integrated into a web console, which is based on a Wicket framework. The figure 3 presents all components involved in designing, generating and presenting reports to the user.


Figure 3 Design of Birt reports.

Diagram details:
  • ReportsViewer - Allows to choose report and values for report parameters and displays report to the user as html page. List of available reports is obtained from reports directory on a file system.
  • Reports files - BIRT reports created by reports designer.
  • Reports Designer - GUI reports designer provided by Eclipse BIRT (see Figure 4). It's a powerful tool and allows to create almost all types of reports and charts you can ever think about. The best is that it can be used by a non technical person, e.g. business intelligence specialist. Also it is possible to parametrize reports, e.g. create report to show profit per sport/report with two input parameters: sport and region.
  • BirtEngine - Generates report in a html/pdf format based on a report file and reports data from data source, e.g. from database.
  • Database - Repository of betting history, e.g. account statement, markets, bets, prices.

Figure 4 BIRT Designer.

Conclusion


Business Intelligence is a crucial element of every automated betting application. Correctly used can significantly improve performance of betting. Moreover, it discovers new horizons and ways of betting hidden behind a huge amount of historical data.

References

Bye,
Daniel

14 comments:

  1. Some interesting food for thought there. Given that your example graph shows only profit for every month, it must be working out well for you! Thanks for sharing this, Jessica.

    ReplyDelete
  2. Yes, it works quite well, even though I'm focus on a technology side of betting only. The profit is a nice side offect:)

    ReplyDelete
  3. Just to note, that IBM did not create BIRT. BIRT was originally conceived by Actuate, and the original codebase was developed and funded by Actuate. Actuate is still the largest contributor to the BIRT project on Eclipse. Actuate also provides a much better and interactive web based viewer for BIRT.

    ReplyDelete
  4. Good point PuckPuck. Thanks for info.

    ReplyDelete
  5. Hi Jessica,

    Other BIRT developers would be interested in how you are using BIRT. Would you mind posting a link to this article in the DevShare area on http://www.birt-exchange.com.

    Thanks,
    Virgil

    ReplyDelete
  6. Hi Virgil,

    It's already there:
    http://www.birt-exchange.com/devshare/designing-birt-reports/780-automated-betting-with-betfair-business-intelligence-and-eclipse-birt/#description

    ReplyDelete
  7. Very good series of posts Jessica. Are you going to be open-sourcing your project on Google Code or similar?

    ReplyDelete
  8. @Robin - Ha ha next joke! If you had a winning method on betfair would you opensource it? Thereby effectively eliminating whatever edge you had and opening yourself up to competition from (guess who) yourself?
    When's your next post Jessica - looking forward to it. I've already learn't quite a lot from your first two.

    ReplyDelete
  9. Hi,

    The application I'm working on is not a winning method itself. It's a domain specific language to write and execute betting strategies, that is supported by many modules, such as web console, history database, machine learning, BI, etc.

    Open-sourcing? I'm thinking about it but currently it's a melody of future.

    Bye,
    Jessica

    ReplyDelete
  10. I'm trying to write one post a month, so next one can be expected soon. The title of next post is: Bet, Trade, Win: Trading on BetFair with Apache SCXML.

    ReplyDelete
  11. Hi,
    I think the following thing would be a must for everyone and i'm not talking about opensourcing the strategies. I just invite Jessica to do more or less what she is already doing by part, that is choosing the more interesting tools of her choice until now (the one with Apache SCXML seems fine for example), then :

    1. describe how to install/configure them for Betfair and eventually Betdaq (as they are the only 2 betting exchanges i know which provide an API)

    2. Based on this, an example of how to read their values and store them

    3. Based on this, an example of how to bet on these betting exchange.

    In conclusion, that is all the technical side except the strategies (each one would have its own "bet engine") and so we should have then things to share after our own fun live tests.

    ReplyDelete
  12. Surely this can just as easily be accomplished using Access ?
    Whatever app you use, its what questions you ask that matter and not the user interface you ask them with.

    ReplyDelete
  13. Hi Anonymous,

    Yes, you could use access, all depends on what you want to achieve and what are your requirements.

    I use BIRT because it's a java engine and my app is written in java, so for me BIRT is better than using Access.

    ReplyDelete
  14. Thanks for the article! I'm curious if you are still using BIRT and in any new ways since the original article was written?

    I recently posted a series of articles on my blog that uses BIRT to analyze a set of data compiled from over 40 internet gambling websites. http://www.bit.ly/cvF3kO http://www.lebirtexpert.com

    ReplyDelete