In laymans terms, what is backtesting?

Discussion in 'Trading' started by amcc, Jun 18, 2006.

  1. amcc


    What is it, and how could one go about performing it?
  2. Taking a theory today and apply it yesterday. Test its outcome

    Software streamlines the it

    if you are a fundemental trader....test what happens 5 minutes before Greenspans/Bernancke statements and 5 minutes after...
  3. In the most simple of terms:

    Looking to see how a trading system/model/algorithm performed on historical data.

    However, don't be fooled into the thinking that all because a trading model trades the past well it will work in the future.

    Many of the blackbox trading systems, not all though, that you see for sale is just over optimized junk.

    Simple ways to avoid over optimization:

    Out of sample walk forward approaches.

    Also, a good system, especially trend following models should be able to display profitability in a number of markers with the same parama

    For example, if a model utilizes a 10 day and 20 day moving crossover for signals that approach should show profitability in a number of markets.

    Keep in mind that financial markets equities, futures, forex etc. for the most part are randomness with trend components.

    For example, if a model utilizes a 10 day and 20 day moving crossover for signals that approach should show profitability in a number of markets.

    Keep in mind that financial markets equities, futures, forex etc. for the most part are randomness with trend components.

    A simple distribution of financial markets adheres to a bell shape curve. With 2/3 of all outcomes within +1 and –1 deviations from the mean.

    The other 1/3 is > than +1/-1 or simple put the market trends. That trend is your statistical advantage.

    I know this is a "little" bit more that what you asked for but crucial nonetheless.
  4. damn lim...

    that was good!
  5. amcc


    Brilliant. LIM that was fantastic.

    How could I go about constructing such a backtest system?
  6. Pabst


    A great 2002 post from as guy who unfortunately spent little time on ET, Rogue Trader. Not to be confused with the troll Zzzzzzzzzzz who was once A Rogue Trader. Two different guys. Obviously.

  7. In laymens of the best marketing tools the "system sellers" have in their arsenal. That said, it can be a useful tool for establishing a point of referance. Beyond that, it's a fools paradise.
  8. Well obviously the first place you need to start with is software that enables backtesting.

    Some Performance Validation Software Platforms:

    1. Trade Station (Can use Trade Bolt to trade signal via another firm)
    2. Genesis FT
    3. Trader Studio (Haven’t tried this yet but the portfolio testing capabilities look very good. They also do a good job of answering questions here on ET.)
    4. Amibroker (More for the experienced)
    5. (FREE in the Sense) - If you into foreign exchange trading the firm I’m at is rolling out a new platform within the next month or so for currency trading that will enable back testing capabilities. (See attached JPG - AaronFX) You will be able to auto enable a trading model on the platform so that all orders generated by the system are automatically executed.

    There are others but these should keep you satisfied for a long time.

    I’m told that for higher end traders an option will be available to host trading systems generated from this platform with a server based solution that will execute via their Currenex platform. (I have attached a JPG from the demo version).

    If you need programming done they have guys who are all certified and can program in popular high level programming languages such as VBNet, C, C++ etc.

    Next you need data in which feed your platform. This depends on what you are trading and the time frame you want to trade. For example, if you don’t plan on day trading you don’t need tick data (the most expensive). Therefore, you will only need daily data which can built daily, weekly and monthly charts. They are many places out there but they do vary in quality so check on the ET boards first.

    Keep in mind that for historical backtesting of commodity futures markets you will need what is called back-adjusted data. More on this at –

    This one if you are new can be a little confusing. The reason for it though is to remove the rollover gap. That way your trading system is not witnessing a profit or loss on the artificial gaps created by futures contract rollovers.

    Testing. This is where things get hairy.

    It can be very easy to create a bunch of rules and curve fit them over past data. That is where the out of sample walk forward approach comes in.

    You will very easily see the difference.

    For example,

    I create a system and back test it on data from 6/15/06 - 6/15/86. Then just keep changing the parameters around until I find something that works. This is the method you want to avoid. If you are purchasing a trading system this is also something to look out for.

    The Out of Sample Walk Forward Approach:

    I have 20 years of data in my files from 6/15/06 - 6/15/86

    I build a system around data from 6/15/90 - 6/15/96

    Then I backtest from 6/15/96 - 6/15/86

    Then, keep in mind at no point have I seen any data from 1996 - 2006, I then “walk the system forward from 1996 to 2006. You greatly avoid the dangers of over optimization and curve fitting this method because you can’t fit rules around data that you haven’t seen!

    Additionally, another very simple method of avoiding curve fitting and over optimization is by testing you system over various markets. You should be able to demonstrate profitability in a number of markets with the same rules. Keep in mind that there are exceptions to this. For example, if you have built a swing trading method for the SP futures.

    More on out of sample building -

    If you need more help I recommend giving the guys at Aaron Trading a call. Well if you want to trade futures or forex. Just tell him John the Drunk Irish Man sent ya. They have been of great help to me. The info above they taught me save me a bunch.

    He recommended a primer book way back initially called The Dow Jones-Irwin Guide to Trading Systems which really helped built a solid foundation. Don’t know all who is who but the guys running the foreign exchange desk are former VP’s of FX at Speers, Leeds & Kellogg (SLK) which is a division of Goldman Sachs.

    That should give you an idea of their mentality. I don’t think some of these guys every sleep! But when it comes to system building and trading in general I highly recommend them. Just don’t go off the commission schedule on their website as I’m paying the same as in my IB account on the discount side. On the foreign exchange side I’m paying $30 per million via Currenex. But I’m also paying on the higher side for a bunch of other services that are considered non-discount.

    If you trade futures and forex they will be bringing on a lot of bunch of new platforms in the months ahead outside of Ran Order and J-Trader on the futures side.

    One other item is make sure to double your drawdown figure. If you trading commodity futures you would add the margins together then add the drawdown figure x 2 to get the approximate capital needed to trade that portfolio.

    Once you capital is large enough you will want to smooth you equity curve with a short-term or day trading system. Rule of thumb is the longer the time frame the greater the profitability but the larger the drawdown. Although the shorter the time frame the more “noise” in the data.

    Use common sense. For example, I once seen a trading system for bellies. It applied some version of the Martangle strategy. At one point the thing was long like 75 bellies. While it looked great on paper you are not going to dump 75 bellies plus 10 more for a net short at one price. You will become your own slippage in this instance. Once again theoretically it appeared to be very profitable but in reality this would never work.

    And that is the end of the longest post I have ever made!!!!