Friday, 18 March 2011

Stochastic optimisation in analysing efficiency of betting exchange markets

Currently, my research is centred around investigating semi-strong form efficiency [1] in betting exchange markets. Semi strong efficient market hypothesis says that all publicly available information about the market is reflected in the current market prices. In other words, this hypothesis claims that it is not possible to make a positive profit from a long term betting, having access to all publicly available information, including historical prices trends, traded volume, news from magazines and newspapers, scored goals and red cards in football markets, number of aces in tennis markets, and so on.

Sometime ago, I reached a point at which my studying of betting exchange markets became complex and time consuming, consequently I decided to introduce stochastic optimisation [2] to boost performance of my research. I present, how I was analysing betting exchange markets before and after applying stochastic optimisation.

Analysing betting exchange markets without adopting stochastic optimisation
  • Collect event driven market data - Market data is collected in a form of market events, e.g. PLACE_BET, CANCEL_BET [3], which is used later for replaying markets with market simulator and betting exchange engine [4]. At the moment I'm collecting data for horse racing markets 10 minutes before in-play time, but in the future I will probably extend the scope of my research to cover in play football and tennis markets as well. 
  • Design trading strategy - For example, to examine a hypothesis,which says that exchange price movements are correlated with traded volume, I design a trading strategy, which represents this claim. If this trading strategy gives a long term profit, then I could argue that market is inefficient with respect to correlation between price and traded volume.
  • Evaluate trading strategy with market simulator and collected market data - Testing trading strategy on a historical data. At the moment I use data sets of 500 horse racing win markets, 10 minutes before in play time. In the world of financial markets, this phase refers to back testing [5].
  • Is trading strategy profitable? - If trading strategy is profitable I claim that market is inefficient and I proceed to prove it by running trading strategy on a real betting exchange markets [6][7]. Otherwise I repeat research process from designing new trading strategy.
A single research iteration, starting with defining market efficiency hypothesis, then designing trading strategy and evaluating it on market simulator takes a lot of time. It's quite clear that some optimisation process would be helpful to speed up this research process.

Analysing betting exchange markets with adopting stochastic optimisation

This version of a process for analysing betting exchange markets introduces one additional step, which is responsible for improving trading strategy applying stochastic algorithms. Consider a trading strategy which places a bet using simple if-else rule:

if(runner.price > betPrice) placeBackBet else placeLayBet.

In this example, stochastic optimisation is looking for the value of the betPrice parameter, for which trading strategy gives the highest possible profit. In reality, trading strategies are parametrised with multiple factors, which makes it much harder and time consuming to search for the best solution in a multi dimensional space. At the moment I use 'co-evolution gradient ascent with random restarts' algorithm, which is described in Essentials of Meta-heuristics book [8]. Still, there are other types of optimisation in my scope of interest, including other evolution algorithms and genetic programming.

I use two separate market data sets for stochastic optimisation and evaluating optimised trading strategy with market simulator. Both sets contain about 500 markets each.

For more information on how I use stochastic optimisation in practice please look at the following unit tests in Scala:
References
  1. Semi-strong form efficiency - http://en.wikipedia.org/wiki/Efficient-market_hypothesis
  2. Stochastic optimisation - http://en.wikipedia.org/wiki/Stochastic_optimization
  3. Design of event driven market data collector - http://blog.danmachine.com/2010/07/bettingai-market-data-collector-design.html
  4. Replaying horse racing markets with market simulator - http://blog.danmachine.com/2010/08/horse-racing-market-simulation.html
  5. Trading on a Betfair Betting Exchange with Apache SCXML- http://blog.danmachine.com/2009/04/trading-at-betfair-betting-exchange.html
  6. Back testing - http://en.wikipedia.org/wiki/Backtesting
  7. Automated betting with BetFair, Business Intelligence and Eclipse BIRT - http://blog.danmachine.com/2009/03/automated-betting-with-betfair-business.html
  8. Essentials of metaheuristics - http://www.goodreads.com/book/show/9734814-essentials-of-metaheuristics