Writing Java Backtesting Program

Discussion in 'Automated Trading' started by jasonbraswell, Dec 12, 2006.

  1. I've been moving more and more to the dark side of automated trading lately, undergoing a big learning phase for programming.

    In this spirit, I wanted to write my own properly object-oriented backtester to test some models I've been playing with lately. Can any of you veterans give me some guidelines on the general architecture?

    Obviously, there will be some sort of base data structure, either representing a bar or a tick, depending on how fine-grained I want it, and I can certainly write all the individual algorithm methods, but I was more concerned with the big picture.

    In particular, what is the best object-oriented way to represent a trading system, a set of buy and sell rules, an optimizer? Maybe a trading system should be an interface, and an optimizer should be a class with a TradingSystem instance variable?

    Just looking for some general guidelines on the class structure and the sort of methods and IVs that should be housed in each.

    Thanks very much in advance.
  2. http://www.elitetrader.com/vb/showthread.php?threadid=80672
    See Frosty...he's done it already...and he is a superb programmer to be able to pull it off.
    You sure you want to take-on this challenge ?
    With all of the decent platforms already out there, wouldn't your time be better spent on trading system development and analysis ?
  3. Gotcha, thanks.

    Yeah, I'm going to give it a shot. I know there are platforms out there, and in the long run, I imagine I'll just use one of those, but I'm viewing this project as killing two birds with one stone. I want to sharpen my programming skills, which, in the long run, I'll use to do other, more novel things.
  4. Feel free to steal/borrow ideas generated from the following thread:


    Any contributions you have to make are also welcome.

    I will be covering various objects that collectively will constitute an ATS framework (supporting backtesting too) over the next few weeks. However, be warned, the pace I will be going at will be slow and measured so it may be too slow for you.
  5. Thanks, Mojo. I'll definitely follow that thread. I can't do any automated brokering yet, but that's definitely the sort of info I'm after for backtesting.
  6. rosy2