Saturday, 13 January 2018

Different Ways of Trading an Algo

Today I am posting the results of a different type of algo. This algo is one that I use on many different markets. It was created by me using momentum and trend indicators. No genetic creativity but purely observation and test based logic.

As you can see, the algo has a little less than 3 years of data in its test results. The reason for this is that, after testing, I discovered that the algo works best by using that shorter amount of data to optimize and then trade it for a month before a new re optimization. In the Periodic Returns Report  you can see the Out of Sample profitability for January so far.

This algo is optimized every month and uses that almost years of data for that reoptimization. During that month the algo trades fully automatically. This means that my expectation is that the algo will trade more consistently than the historical statistics show, particularly that the drawdown is expected to be much less.

Its important that proper testing is done. Its not just a matter of pressing the OPTIMIZATION button and taking the most profitable result. The internal results of the optimization, such as symmetry, distribution of trades, average trade, ratio of draw down to profit are critical. I've posted links in this blog to the books that I recommend if you're interested in this way of trading. I'll be writing more on this theme.


  1. How would you test for robustness against a non trending period, say all assets classes in the period 2007 - 2009.

    since 2009 she went in one direction only, so fairly easy to trade in that pattern.

    In addition do you test for sudden changes in volatility and ADR, and then back to previous ADR?

    1. Robustness testing is not dependent upon type of market at all. Robustness testing is looking at just the metrics of your results during the creation of the algo and only accepting those algos that pass the filters I have ordained.

      I don't think that looking for "sudden changes" is a good idea. Trying to filter out all losing trades just ends up curve fitting. The whole process of creating an algo is to create one that does good enough in the training and then holds up well enough - better than say 50% - in the testing. Algo creation has become a lot more sophisticated nowadays compared to even 5 years ago.

  2. Right, what I meant was if the inputs change (market cyclicality, volatility, ADR, swing amplitude) and it wasn't in the in-sample data, how would you make sure the algo didn't keep trading as if the conditions were the same.

    That what sudden changes implies, tomorrow morning the Swiss bank can wake up, unpeg the Swissie against the Euro, and a lot of uncle points can be hit before one can react. Or China puts in currency controls 100%, and all markets react asymmetrically. Point is, how do you know if the algo is still valid.....

    Do you monitor the boundaries of drawdown in an algo?

    1. When there is a major event then I stop trading an algo until the market for that symbol normalizes in the next few days. Then I can re-optimize but I may cut out the data from the event in my re-optimization databank so it doesn't skew the optimization. The Swiss unpegging is a good example.

  3. Ok, lets say, one wanted to build a rudimentary algo for CL WTI. Which has a nasty habit of being schizophrenic.

    So it can keep having these ADRs that rotate nicely around 125ticks - 150ticks per day for days and weeks, and every now and then (which I expect), it switches to 200 / 400 ticks unidirectional on no news or inconsequential news which may last a day, or 2, or 3.

    Would that make it a more difficult trade to create an algo? or how would approach that?

    This leads to a similar - as there some markets, say - NQ for example which tend to have, less schizo action (for lack of a better word)? And are there more suited to algo building in the fashion you suggest?

    Would you say one take in more in-sample data for this? As one way to build a more robust algo.

    1. Sandy, you're looking for a short answer to a two day question. Its lots more complicated than that. Create a decision flow chart to take you through the process like I did. Starting point after you have chosen the symbol is to look at risk & reward to determine periodicity. My flow chart takes me through the process choices and then its a matter of a lot of testing.