Sliding optimization and/or Adaptive Parameters?

Discussion in 'Strategy Building' started by travis, May 19, 2003.

  1. travis


    Once we have created a system we consider good enough to trade, there is one more problem to solve - how long of an interval should we continuously optimize it on?

    If we find out that by optimizing it on different time intervals - the last month, year, decade - that certain parameters change greatly, then we could have two solutions - either:

    1) finding out on which time intervals the system's parameter should be optimized to give the best return.

    2) have the system continuously adapt a given parameter in order to be as efficient as possible.

    For example, in my system, that does about 1 intraday trade per day on a 5-minute chart, the parameters are:

    1. ma crossover
    2. time zones (outside of which trading is not allowed)
    3. volatility filter
    4. stoploss

    Now, I would find it reasonable if stoploss, time restrictions and moving averages didn't change. So only our volatility filter changes, and without it changing our system's return would suffer greatly.

    So how do we adapt this volatility filter?

    1) There could be an easy way - continuously optimizing it. But then how do I know which interval I should use to optimize it, and how do I know if this makes any sense? I would have to go back in my 5 years historic data, optimize the system for january 1998, then use it for the next week or month, optimize it for february 1998, and test it on the next week/month....then try optimizing it for two months at a time, then 3 months at a time - simply impossible to do manually.

    So the answer is this - either I find a software that does an "optimization of the optimization", and checks all combinations of "sliding optimizations" giving me the best one to use, or I can do try to use the second solution.

    2) I can try to bind my volatility filter to some other - yet to be found - parameter that has some correlation to it.

    So I ask you, before proceeding to the second, less complicated, solution - is there a software that could implement a "sliding optimization" telling me which intervals my system should be optimized on?
  2. travis,

    I was just reading something yesterday that might be applicable here. Think of the system as a filter for trades only allowing trades of a certain type to be recognized. You are not trying to find all trades just the most probable ones. As was said in my reading it is better to try and predict the small ripples rather than the big events. I was advised some time ago here to focus on the 60-minute bars and the dailies for perspective on trading the 5-minute bars. Since volatility is different for different time frames you must first decide to discover what the average volatility is for the time frame you've chosen -- the 5-minute bar. Then look at how that average changes during each hour of a day for a number of days back say about three months worth of data, around a thousand hours. Once you've found the differences of the 60-minute changes and found their average you will know the typical volatility 'environment' for your system. Since you are wanting to trade the extremes of the 'environment' you are looking for the values outside of the standard deviation, in other words about 32% of the cases once you identify the boundary of this value you know when you have a volatility spike beyond it that that hour produced a move beyond average. So, just summarizing, you will know that in the last 1000 hours that just roughly 320 of those hours will have produced a trading candidate. Once you've isolated those hourly bars you can then characterize them using your five minute bars and discover the 5-minute volatility setting that best captures the move. You might go a step further and check to see if the days those roughly 320 trades were produced exhibited big moves as well.

  3. travis


    Your advice about different time frames makes sense, and, also, it reminds me of the infinite possibilities of studies that could be made. And Tradestation makes most of them possible.

    I already started in this direction in fact, the study of the one parameter that may be the one to vary the most during the 5 years of data I have.

    I divided all my data into 10 semesters, and on each one I will optimize my system, hoping to get this outcome - no significant change in moving averages, time limits and stoploss, and a huge change in the optimum volatility required to trigger a trade.

    Then I will write down all data for all 10 semesters, and see what are the ranges for the two values that make up my volatility standard deviation filter - "volatility length" (how many 5 min bars) and "volatility value" (what value). These 2 inputs may vary a lot. Then I will try to bind them to something else - anything, be it day of the week, rsi or, as you suggest, a different time-frame measurement of volatility.

    In the meanwhile, though, if anyone finds a software that can provide a "sliding optimization" of a system, please let me know. In other words, a software that will eventually tell you what is the optimum time interval to optimize your system on.