Back testing futures -- last trade or best bid/offer?

Discussion in 'Strategy Development' started by macdice, Aug 29, 2010.

  1. macdice



    I am trying to design AI-based trading strategies for short term futures trading, with holding periods from a few seconds to a few hours. I have heard that back testing using the last traded price is a bad idea, and that you should somehow take the orderbook into account. Unfortunately, my current historical dataset has just time and sales (it is a series of (time, price, volume) tuples for each contract). Does anyone have any tips for how to deal with this problem?

    One thing that occurred to me is that I could simulate slippage by using the next trade price after the point at which a trading decision is made, ie as if my hypothetical trade were the next real trade that happened in the dataset.

    Even if I did have a full set of bid and offer data, I'm a little bit confused about how I would use that -- the best bid and offer prices are usually spread either side of the last trade price (based on looking at the Bloomberg GIPT screen), so if you traded at those prices then you would almost always get a worse price than the last trade, despite the fact that in reality many trades are at the same price as the previous one (based on a cursory glance at US morning NQ trading from the 20th... but maybe I should look at more data before making generalisations like that...)

    I've been working with FX data for many years which consists of simple bid/offer quotes from OTC dealers, but my grasp of exchange/orderbook mechanics is fledgling, any good articles on simulation with and without level II data would be very much appreciated.

  2. It all depends what you want to do. If you are backtesting a high freqency intraday startegy then you need bid-ask prices, especially when there is a frequent opening of the spread like in forex markets.

    If you are backtesting position or trend following systems with daily data you should not worry about that. Use last price.

    If you are in a liquid market you can use last price and then add/subtract as slippage the average bid-ask spread.

    If you are backtesting not so liquid markets you will need to know the mean and standard deviation of the bid-ask spread and take mean + k x sigma for slippage depending on how conservative you want to be.
  3. MGJ


    There's a member here named "mizhael" who works for a hedge fund -- admittedly as a grunt, a bottom of the totem pole gofer, a clerk. However he has access to some super-smart people at his office and can potentially help you A LOT by relaying your inquiries to People Who Know What They Are Doing. I suggest you send mizhael a private message and proceed to pick his brain.
  4. Try recording a few sessions of market data using market replay feature of OEC Trader (Free Demo). You can capture DOM and T&S data for analysis and to test your algos. CME datamine licenses historic order book data.
  5. OEC can do that? I din't know. Thanks for the information.