Tuesday, 3 July 2012

Successful Trading with Algos Part 4

OK, you have created an algo and have picked the type of market you want to run it on with filters. It looks great over the last six months. I say six months because for a day trading algo you are not interested in how the market behaved two years ago as it's different now.

Here's an algo's results that I use on Light Crude.

Your next step is how to keep the algo in tune with the market. That means periodic reoptimization in a way that does not curve fit. I do that by testing a reoptimization regimen that walks forward. For example, I may take 20 trading days of data and reoptimize and then look at how it would have performed on the next 5 days of unseen data. I start this at the beginning of the six month period of back history and walk it forward every 5 days using the last 20 days of history and seeing the results on the next 5 days of unseen data. What I produce in MultiCharts looks like this:

 It's a pretty wide pic but let me draw your attention to some facts.
  1. The original Nett Profit in the first pic is $13,008
  2. When I add up the Out of sample (OOS) column profits the total is $6442 which is a more realistic of what would have happened using this algo to trade after reoptimising every 5 trading days using 18 days of historical data. The OOS P&L is the results of the algo on new data after having reoptimised on the 18 days before.
Doing the original work to get the results in #1 is just a first step. Getting a stable result from Walk Forward Analysis is what you need to get a more realistic representation of what is probable. Note that I say "probable", not possible because it's more certain than that but not "certain" because I cannot guess the future. What I do is trade with the odds - probabilities - very much on my side. 

Today's trade using that algo is below. The interesting thing is that you can run this algo in a "turn on and forget" mode or trade with it using it for entries and then manually manage the exits. Also, I have some different exit strategies that I can bolt on to manage the trades automatically to further improve profitability.

What I try and teach my students is to go through a process of building a potentially successful algo based on realistic expectations.


  1. Hi EL,

    On trades #1 and trade #3 from your chart:

    (a) Trade #1: Why is a long trade being made at the low of the long signal bar? Shouldn't the long trade be entered at the close (high) of the completed "up" renko bar?

    (b) Trade #3: A short trade is being made from the high of the signal bar instead of the low (close) of the bar.

    Trades 2,4 and 5 seem to follow your regular entry rules for renko bars. That is, enter on high (close) of the signal bar to go long and the low (close) of the signal bar to go short.
    Are you using different entry rules now?


    1. Anon 17:01, Flo's entries are on limit orders based on the bar when the picture completes. These are auto trades and not my discretionary trades and based on the code in the algmo.