My process and criteria on algorithm trading strategies

Though I haven't found any workable strategies to run on my live account yet at the time writing, I have built some regular process and criteria on hunting algotrading strategies. In this article I will introduce the process and criteria to share experience and collect your any feedback.

The process

Step 1, Back testing

After implemented a new strategy (or say, robot), the first thing is to back test the strategy on all instruments in my database. There are two purposes to back test, first is to get first perspective on the strategy, second is to find the appropriate time frame the strategy works on.

It's high chance that we get below equity curve,

Then I will try it on other reasonable time frame. If it becomes like this,

Then the strategy has some potential. Otherwise, the strategy won't work at all, I will either modify the strategy or just abandon it.

I usually back test on 30 Forex pairs (28 major + 2 metal). Some times I test on CFDs provided by Oanda, such as Stock Indexes, Bonds, etc. I usually back test since 2010. The era before 2009 is before the US QE and the market is quite different, and I don't think a non-holy-grail strategy should work on so many years. At the back test stage, I require that all instruments must at least survive. That's to say, no instrument should put the equity curve to zero.

Step 2, Optimization

After a strategy passes the back testing stage, I then optimize the strategy to see what happen. Optimization is done on since 2010 too. At this stage, the goal is higher. I expect to see this,

Of course the result depends on the strategy type, and not all strategies can produce that nice equity curve. But at least, some instruments should general good curve with decent profit and small draw down.

I don't optimize on a lot of adjacent parameter values, I only optimize on some reasonable parameter values from my mind. For example, for a two moving average cross over strategy, instead of optimizing on 5, 6, 7, …, 100, I may only optimize on 5, 13, 34, 65, 100, which are arbitrary values. There are two reasons I do so,

  • Too much values may cause data mining bias and curve over fit.
  • Too much values may cause too much time to optimize. This usually is not a big problem on optimization, but it will cause a lot of trouble on walk forward.

Step 3, Walk forward analysis

Optimization is the source of curve over fit. Walk forward analysis jumps in to help avoiding curve over fit.

The walk forward in sample and out of sample window size depends on how many trades the strategy generates. Some example window sizes: IS 12 months and OOS 3 months, or IS 4 weeks and OOS 1 week. Usually the in sample window size is 4 times of out of sample.

Walk forward analysis is my last step on testing a strategy. I didn't use Monto Carlo simulation, and I'm not sure if I should use it.

The criteria

Criteria on back testing

  1. All instruments must survive since 2010.
  2. The equity curve on all instruments should not be down slope. At least most of them should be up and down.

Criteria on optimization

  1. Number of valid parameter sets > 60%. Some parameter sets are invalid if they can't generate enough trades. I require at least 30 trades are generated.
  2. Number of profitable parameter sets > 80%.
  3. The profit should be good. Depending on the time duration. If it's since 2010, I require at least 100% profit. Note it's not that much as it sounds, because the real trading should generate much less profit than testing.
  4. The draw down should be decent. If it's since 2010, I expect the max draw down is less than 20%.
  5. Enough trades. It's not good the strategy generates only 10 trades in each year. Fewer trades bring higher chance of curve over fit.

Criteria on walk forward analysis

  1. 12~20 sessions are tested. I like to use 16 sessions.
  2. Walk Forward Efficiency >= 0.5
  3. The latest 2 sessions must be profitable.

My these criteria acts as guideline to me and not discipline. I'm discretionary on assessing the strategies.

If you have any advice, comment and let me know. :-)


Enter your comment. Wiki syntax is allowed: