Milktrader

Iterating Until Convergence

Sunday, July 4, 2010

Programming for Traders

You have to start somewhere, so I might as well start in the middle. I've  been busy the past few months getting myself up to speed on programming technology. I'm using the 'throw a bunch of balls in the air' approach to things. You won't catch everything, but at least you can make a lot of noise. I started by purchasing a backtesting program about a year ago, to give system trading a go. Well, you need to learn to program your backtest so you soon find yourself in the Wonderland of programming. And you know what happens when you go deeper into the rabbit hole.


I finally reached the bottom when I began studying assembly language. This was the bottom. In fact, it was below the bottom. The bottom for me is marked by 5 decisions:
  1. Migrate to Linux (Ubuntu)
  2. Learn command line programming (bash)
  3. Decide on a good text editor (VIM)
  4. Create a repository system (svn)
  5. Learn (I mean really learn) your first programming language (C)
This is the foundation I need to build robot(SPX), my custom-made function designed to extract money from markets. The goal is to attain a level of proficiency in these five building-blocks and not necessarily become expert before moving on to the next set of laboratory supplies. Here is what is next on my building plan:
  1. Learn C#
  2. Complete R migration to Linux platform
  3. Build proficiency in Neural Network theory
  4. Build proficiency in Statistical Learning theory
From there, the stuff I want to make includes:

  1. A neural network predictive model
  2. A statistical predictive model
  3. An R package for backtesting, optimizing and walking forward systems
And then I will goof around a bit by learning Python, Perl, Ruby. By the way, I have a wife, three kids, a dog, three goldfish and a full-time job. I just don't sleep.








6 comments:

  1. Your setup sounds similar to mine: Kubuntu, emacs, Scheme.
    ReplyDelete
  2. Milk: what's the type of frequency you plan to achieve? I ask because I think that it looks like you could be very well with a combination of R, and something like Trading Blox, maybe Neuroshell for starters. You could hack an execution system in some way using Linux, maybe via Python, and something like ibPy,or something more ad hoc like this.
    I ask you cause it looks like some stuff will take you too much, unless you're doing it for fun. Cheers, Cord
    ReplyDelete
  3. @cordura21

    I've looked at Trading Blox and Neuroshell. These are both good tools, but I still don't get the flexibility I'd like. I'm not sure if there is a way to customize TradingBlox backtest reports, but if you were interested in comparing the system's performance as a percentage of perfect profit, could you program that into the report? I suspect not. You could maybe request them to include that as a metric, but what if you're developing new metrics all the time and maybe have developed some that are proprietary?

    As far as Neuroshell, it also appears to be a good tool, expect their algorithms are all proprietary and you can't introduce your own into the software. If you'd like to take the R DOptim free-source PSO-like algo and run it, you'll have to take another route.

    I have invested in Peltarion's Synpase NN IDE. I call it an IDE because it looks like a Visual Studio layout. It includes many C# algos and - this is big - allows you to import your own algos. If you take R's optimization algo, write it in C#, you could in effect use it through the Synapse IDE.

    With Neuroshell, you cannot use cutting-edge optimizers and have to wait for the company to develop their own.

    I'm focused as much as possible on open-source because once you make time and money commitment (time being more critical) into a vendor-specific solution, you are at the mercy of that company staying in business and continuing to support their product.

    @Matthew, I never heard of Scheme until you mentioned it and a quick stackoverflow.com search was interesting.
    ReplyDelete
  4. This comment has been removed by the author.
    ReplyDelete
  5. Let me tell you that I try to open source as much as I can, so we start from the same point, in fact Ubuntu gave new life to my laptop.

    I think the main issue is in "trading infrastructure", and I hope the BLOTTER package in R will help (do you know of alternatives?)

    i like TBlox for many reasons, but don't want to sound like a salesman. All of what you said can be done (and I did it) on TBlox, but overall it's a great set of "crutches" to keep you thinking all the time in the right frame of mind, since it has the whole "trading system" metaphor inside it. Hope it makes sense.
    ReplyDelete
  6. R quantmod and blotter are way, way behind TBlox, no question. The only other software that does portfolio level backtesting is TradersStudio, that I know of.
    ReplyDelete