Time to Trade Tennis

Tennis is my favourite television sport, after cycle racing. The sport is also my favourite sport to play now that I am getting on in years and am no longer able to cycle at the level I once did. I have never considered trading tennis before because horse racing was sufficiently challenging but with my book out of the way I have time to consider new projects.

The sport of tennis is relatively simple to model as the sport is a head to head between a pair of players or a pair of partners in doubles. Unlike football there is always a winner in tennis so the draw is not a consideration. With the exception of Davis/Federation Cup games there is no concept of home and away. The days of home nations dominating Grand Slam tournaments are probably over. 

The scoring system in tennis favours the player who wins the most points (an obvious statement to make but stay with me). This can be seen in an interesting simulation using Monte Carlo methods created by Michael Maboussin author of The Success Equation. If you click on the following link then you will see the simulation in action.

Tennis Simulation

With players of equal ability the probability of either player winning the game is 0.50 but you only have to play around with the simulation to see that a player who is only marginally better than another player has by far the greater chance of winning a match. Indeed with a 57.7% chance of winning you guarantee victory with a 1.0 probability of winning the match. I can vouch for that personally. Being rather middle-aged and decrepid I tend not to play singles games as I am guaranteed to lose. I am better suited to the slightly more static role of net poaching in doubles.

In reality not all games go the way a simulation might have you believe. The top seeded players lose games for a variety of reasons. Their abilities might be waning but it takes time for them to drop down through the rankings. A player might treat a tournament as a training exercise and withdraw after a couple of rounds or their mind might be on a more prestigious future tournament and they make too many mistakes and lose a match to a lowly ranked player.

Data for tennis matches is very easy to come by and is usually free. There are also websites where you can match up a pair of players to see how they faired against each other in the past. Once such site is MatchStat and can be found at the following link.


Just enter the names of the two players in a singles match and you will be shown their previous matches against each other. However, it is not just a simple matter of creating a probability from the number of times a player has beaten another. As you will see in MatchStat, games are played on different surfaces with some players preferring one surface to another. The players at the top of the ATP rankings will be mindful of their ranking points and build their season around the bigger tournaments such as the four Grand Slams and the ATP Tour Masters 1000 tournaments. The lucrative ATP World Tour final at the end of the year is also borne in mind too.

Currently, I am working on my own Monte Carlo methods simulator, which will allow the user to model some of the aspects mentioned above and permit "What if?" scenarios to determine how various factors alter the probability of winning a tennis match. With probabilities you can derive odds and use them as a basis for trading with.

See Also

Tennis Citations - Some academic work on tennis trading

The Hidden Mathematics of Sport - Contains useful mathematical facts on tennis and other sports

Back to Work

Completing the book was a long six months, full of doubts and rewrites. I am glad that the book is finished so that I can contemplate new projects.  But just because I have put all my code into a book doesn't mean that I have nothing left to write on this blog. My observations of bot trading on Betfair will continue and decrying some of the nonsense you read elsewhere.

There is more code to write, which will probably find its way into another book in the years to come. Then there are my investments to catch up with. I am very much a believer of "getting rich slowly". Not everyone can be an Elon Musk or Richard Branson, creating a string of successful money making products. In fact, very few of us can. It's all part of the normal distribution. There is little space at the top of the distribution peak for many people. Every winner needs a loser and every big winner needs a lot of losers. 

Be happy with what you have and make the most of it. By all means try to improve your lot but don't gamble for it. Invest wisely with your time to increase your knowledge and invest wisely with your capital to increase your wealth. There are many who win big only to lose big later. You can make a lot of money quickly and lose it just as quickly. It's all about risk and reward. The more risk you take the bigger the reward but also the bigger the potential loss. 

I am sure you have seen plenty of blogs where people run up large wins at the beginning and then the blog ends abruptly. Blogs where people proudly boast their winnings but withhold their losses, even manipulating the figures or starting over so as to hide their failings. Sports trading is only a small part of what I do. I am in no hurry to make large sums of money. Approaching my fiftieth year means that the money I have gained from working for others is all the money I will ever have from that route and so I have to invest wisely. Today I only earn what I can scrape off the Internet. I have money in Peer 2 Peer investment sites, I write about trading, I code trading strategies, I do the odd consultancy job, gathering money here and there. My life is varied and its my own. No nine to five and no manager. Time for a holiday.

Programming for Betfair

Programming for Betfair, a guide to creating sports trading applications, is now available on Amazon. Using the freely available Visual Studio I show the reader how to build an application that gets prices from and places bets automatically into Betfair's exchange.

Also, the reader can build databases from Betfair data for offline analysis. Data can be saved whilst the trading application is running and then converted into a CSV format for a spreadsheet where it can be manipulated, charted and analysed for the creation of trading rules.

There is also a chapter on improving the charts on Betfair's website. Charts can be grouped together for comparison and updated automatically to keep the trader up to date with the latest trends in the market place. The final chapter touches on some advanced techniques such as the creation of trading indicators, volume analysis (specifically VWAP - volume weighted average price), low-latency optimisation, arbitrage, machine learning, Monte Carlo methods and more.

Some Screen Captures from the Book

Betfair's visualisers are used to demonstrate how JSON is used to communicate between the reader's computer and Betfair's servers. The reader is then gently led through the creation of JSON request strings and the processing of JSON response strings into raw data for use by the application.

The price engine with a bet placement control for experimenting with various bet types. The user is then shown a non-graphical way of inserting bets into the exchange for automated trigger betting.

A ChartBot can easily be created for multiple views of Betfair charts, side by side. They can also be set to auto-update.

The application created in the book can build databases of data for offline analysis in a spreadsheet so that the user can analyse the data and build trading rules.

For the contents of the book click here. (PDF format)

Six Books to Start You in Sports Trading

I have recommended a lot of books on this blog. If I had to recommend a small subset of books for you to start your sports trading career then the following six books would be the ones that I would choose. The selection would also be of interest to the intermediate trader looking to improve.

You will notice that there are no handicapping or form following books amongst the selection. Nor any books on speed or biomechanics. You don't need to know what makes one horse better than another to make money from horse racing. The same can be said about other sports too. As I have said before, market structure and simple concepts from financial trading are more important than the sports themselves. Let the market determine the price. You just need to trade on its movement whilst the market discovers the true price of an event.

Here are the books that you should be reading to give yourself a head-start in sports trading.

Efficiency of Racetrack Betting Markets

This is the book that started me thinking that market structure was more important than fundamentals. After reading this book in the 1990s I stopped trying to determine which horse would win a race and concentrated solely on the horse most likely to yield me a profit. The book is an anthology of academic papers written mostly by researchers in finance using sports betting markets as a proxy for financial markets. Although it is an expensive book the papers are written by such authorities as William Ziemba (Doctor Z) and Willian Benter (a famous bettor at the Hong Kong races).

Amazon - Efficiency of Racetrack Betting Markets

Taking Chances: Winning with Probability

Probably the most complete book on gaming and probability that you could wish to own. Written by Dr John Haigh from the University of Sussex the book takes the reader through the required amount of probability theory to understand the topics in the rest of the book. Topics covered include football,horse racing casino games and other game of chance where people may be tempted to back their opinion with cash. Also included is a thorough working of Kelly Criterion for both single and multiple bets. This book remains on my desk and never gets put on the shelf.

Amazon - Taking Chances: Winning with Probability

Sports Trading on Betfair

An excellent book that teaches aspects of market structure to beginner and intermediate traders. Wayne Bailey teaches the importance of the integer prices (2.0, 3.0, 4.0 etc.) as support and resistance points. He explains in clearly and concisely two methods for scalping that do not rely on the usual scalper hunces. The book also covers more traditional technical trading systems from the financial world. These systems include support and resistance trading and swing trading. Also covered is Dutching, arbitrage and weight of money (or weight of movement as it is called in the book). There is a also some tentative analysis of inplay system trading.

Full review here

Amazon - Sports Trading on Betfair

Secrets of Successful Betting

This book is full of information about how horse race betting markets work. Starting with a history of bookmaking, the book teaches you how bookmakers ply their trade. Later chapters demonstrate how to perform arbitrage, Dutching, multiple bets, hedging, coupling prices, making a backer's book and deriving place prices from the win markets. A very useful book indeed and one that I know many readers of this website have bought. Although it is now out of print, the book can still be picked up secondhand, at a reasonable price, on Amazon.

Full review here

Amazon - Secrets of Successful Betting

Calculated Bets: Computers, Gambling and Mathematical Modelling

Steven Skiena of Stony Brook University has a lifelong passion for the sport of Jai Alai, a ball game from the Basque region of Spain. Akin to squash, the game is played with baskets attached to the hand rather than with racquets held by the hand. The book details Steven's building of a model for the game of Jai Alai with which he used for betting on the games. Steven builds a Monte Carlo simulation of Jai Alai so that he can test his theories about the likelihood of any one particular player in a matchup winning the event.

All-in-all this book is a fascinating read. Some find it hard going but I can appreciate all the hard work that Steven has put into mastering modelling a sport and betting on it. If you want to know what it takes to model a sport and build a bot to place bets then you need this book at hand. You won't learn how to program specifically for your requirements and this book was written before Betfair took off. However, you will learn what it takes to dedicate yourself to a related task.

Full review here

Amazon - Calculated Bets: Computers, Gambling and Mathematical Modelling

How to Find a Black Cat in a Coal Cellar

http://www.amazon.co.uk/gp/product/1843440679?ie=UTF8&camp=1634&creativeASIN=1843440679&linkCode=xm2&tag=thegoodlife08-21This book has two uses. Ostensibly the book was written by Joseph Buchdahl, who owns tipster evaluation websites, to demonstrate how he goes about evaluating tipsters. Usually, to the detriment of tipsters as most of them are either rank amateurs or fraudsters. However, the book can also be used by the system builder to evaluate their own success. If you don't have time to trade then this book will help you to develop a portfolio of tipsters' systems for you to invest in.

Full review here

Amazon - How to find a Black Cat in a Coal Cellar

Sports Trading on Betfair

This book is a recent addition to my library. Self-published by Wayne Bailey, owner of the blog Wayne Bailey Racing and a regular writer on betting in The Irish Independent newspaper.

I am always rather dubious of self-published works. There are many self-publishing platforms and it is easy to search for the publisher of a book to determine if the book is an act of vanity publishing. Many books promising get-rich-quick schemes, of which gambling is an obvious example, are self-published either because a reputable publisher does not want to be involved in telling untruths or because the author has no expertise in what they are writing about.

That being said at least Amazon allows you to read the index of any book it sells to determine if it is worth a read. I was drawn to the contents of this book and so I decided to buy it. Having read the book I can say it is certainly one of the best self-published books on sports trading that I have read. Indeed there are some things in the book that some traders might wish had never been published but which will now be in the pubic domain.

As is usual for this kind of book the opening chapters consist of the basics about how exchanges work and obtaining 3rd party software with which to trade. When asked about my trading style, I like to say that I trade market structure more than anything else. I don't know anything about horses or horse racing but I do know markets, no matter what is being sold in them. I can see from reading this book that Mr Bailey has understood the structure of horse race betting markets and uses this information to his advantage. A lot of it is psychology combined with the way the exchange is set up.

The first topic in the book points out the rather obvious fact (although many people still haven't noticed it) that the integer odds (2.0, 3.0, 4.0 and so on) are very important when trading. Looking at 2.0 we see that 2.1 is 5% greater than 2.0 and 5 ticks above. However, 1.9 is 5% below 2.0 but 10 ticks below. This is because at 2.0 we are transitioning from a 0.02 per tick change above 2.0 to 0.01 per tick change below 2.0 For a layer, this is good because we have so much more leeway if the best goes against us. There is more upside to a price drifting out and resistance if it reverses. This is true for all the integer odds. This is what I call trading market structure. It has nothing to do with the sport or its participants but everything to do with how the market is set up. And this is what makes Mr Bailey's book a cut above many others.

Mr Bailey then moves on to scalping and does so in a far more intelligent way than I have seen before. Watching YouTube videos or reading other blogs or forums you would believe that successful scalpers have magical powers. They don't. Through reading this book a logical reason for profitable scalping is given. You won't be a successful scalper if you don't have the correct psychological profile, the right software or hardware but all things being equal the two scalping systems Mr Bailey gives are the ones that I have used successfully. In fact I don't like to sully the techniques with the word 'scalping'. It is common sense one-tick-trading.

The book also covers more traditional technical trading systems from the financial world and that I also use. These systems include support and resistance trading and swing trading. Also covered is Dutching, arbitrage and weight of money (or weight of movement as it is called in the book). There is a also some tentative analysis of inplay system trading. Although, Mr Bailey states that he is new to this and working on new systems. However, he does talk you through some of his current systems to give you an idea of how systems are built.

All-in-all I recommend this book to all beginner and intermediate traders looking for new ideas. The main thing to learn is how to trade market structure more than anything else. That is how I trade the markets and so should you.

Scared money

When I used to play poker in one of London's casinos you would often hear the phrase "scared money". The phrase refers to the cautious players, beginners etc. who didn't want to risk too much money. These players would play with a very small stack of chips in front of them and when it was gone they would walk away. They would do all they could to protect their little stack of chips and that meant dropping hand after hand until they had a monster. All I had to do was drop my hand whenever they kept theirs.

My bankroll for such games was always a lot larger than my opponents. They would buy in for £50 or so. I would buy in for £500 or more. There was never any intention of using the full £500. I just wanted everyone to know that I had them covered. The value of my stack was immediately forgotten as I tried to bully people out of a hand. Poker is more about finding the right players to play against than anything else. Whenever I went to the casino I would say, "Hello" to my acquaintances, as I passed them by, heading for the easiest table I could find. Usually, a table with tourists or people I knew that had just started coming to the cardroom and were still learning the game. But what has this to do with sports trading?

A common question from beginner traders on the forums is, "What size should my bankroll be?" Alternatively, they will say, "I am going to start with £50 and see how it goes." Immediately, I know their money to be scared money. A common outcome for a beginner's small bankroll is that it will dwindle away because the fear of losing the bankroll doesn't permit them to trade effectively. When they start trading, all they can see is a zero, sometime in the future, at the bottom of their spreadsheet's profit and loss column. From that moment on, the beginner trader will be more concerned with not losing money rather than winning money. Any small reversal against them and they are out for a loss, only to see the market swing back in their favour.

Before you determine a bankroll size, you need to determine a winning system. That system will have an expectation or expected value, in other words, how much you can expect to win per £1 bet. Of course, you cannot expect to make exactly what is expected. Indeed, a winning system can lose for while and a losing system can appear to win before reverting. There is no real answer to the question, "How big should my bankroll be?" Your bankroll should be big enough to cover the volatility of your trades. Only experience and a history of previous trades will give you a value for the variance of your returns. Whatever bankroll you decide upon, its value should be forgotten. Your prime concern now is to trade to win and never not to lose.

Low-Latency Trading on Betfair

BetAngel is now offering co-located servers for trading on Betfair and BetDAQ. This is a new service and not related to the original VPS that they offered. The servers are not as close to the exchanges as in financial trading (where the distance between exchange and trader servers is measured in metres) but as close as Betfair will allow you to get.

Already, BetAngel have reported denial of service attacks on the servers (see here) to deny or slowdown the service. The chief suspects being those who wish to protect their preeminence on the exchange. In the past I have reported on Betfair's use of their own traders and bots to increase profits and that Betfair's exchange is probably a dark pool. Low-latency activity by sophisticated bots leads one to believe that the playing field is not level for all participants.

Maybe it is time for tighter regulation of betting exchanges to ensure that the public are getting a fair deal. I am keen to move my own bots closer to Betfair's data centre. However, after reading of the problems that BetAngel are having, I would locate my bots to servers that are not advertised as being dedicated to giving the fastest access to Betfair.

Still, I wouldn't put it past an exchange to have a team of people logging access times and running a bespoke attack on an IP address, no matter where you are located. More so than ever, as with the financial markets, making money from sports betting has less to do with sport and more to do with market structure and taking advantage of it.

Further Reading