WFA – Am I doing it right?

Forums ProRealTime English forum ProOrder support WFA – Am I doing it right?

Viewing 9 posts - 1 through 9 (of 9 total)
  • #42252

    I have read quite a lot about WFA and thought I have understood how one should use it. Anyway I have grown a little insecure if I do it right because I see most people are uploading backtest that are obviously optimized differently than I would do it.

    I am doing like this:

    Let’s say we have 5 years of historical data. Then we are lucky and have found a strategy that performs well during WFA. Let’s assume we optimized with an in-sample period of 12 month and an out-of-sample period of 3 months. The strategy produces good results and has in every OOS period 60-80%. When I have come so far and decide to set the strategy live I would optimize again but this time a regular optimization (no WFA) over the last 12 months. This would give me the parameters to trade with for the next 3 months.

    This is what I’m doing. So the parameters that I run live are the optimization results (in this example) from the last 12 months (no longer). If I then decide to run a standard backtest over the whole 5 year test period the result if of course very good during the last year but not so good for the time before. Anyway I think the is the way to go though one can not present a good looking 200K bar backtest with the last parameters.

    Now the question, am I doing it right? I think I do but I get insecure because here people upload 200K standard backtests that are obviously optimized over the whole period and are proud to present a nice equity curve.

    Another caveat for everybody using WFA (I made this mistake in the beginning). If you run a WFA it is important that there is no serial correlation between the trades otherwise the results become distorted. For example if you use some sort of position sizing, always deactivate it for the WFA.

    1 user thanked author for this post.
    #42253

    Now the question, am I doing it right? I think I do but I get insecure because here people upload 200K standard backtests that are obviously optimized over the whole period and are proud to present a nice equity curve.

    You explained it right, this is how everyone should use the Walk Forward tool!

    For example if you use some sort of position sizing, always deactivate it for the WFA.

    Right again, each strategy should be tested with the same position sizing over the whole backtest. If it performs good then any position sizing code could be added.

    1 user thanked author for this post.
    #42290

    Thank you Despair for putting it so clearly – that is the best description of how to do a Walk Forward optimization that I have seen so far.

    A quick question for Nicolas – is the walk forward results based on best GAIN or best AVG GAIN PER TRADE?

    #42292

    The current version of the WF module is based on best gain for the whole analysis (like the classic optimiser). I know it is planned to add more sorting criteria in a next version!

    1 user thanked author for this post.
    #42302

    Thanks for the quick reply.

    I assumed it was based on GAIN not AVG GAIN PER TRADE. I think that the latter is a far better representation of a systems performance so look forward to this option being added soon. Any idea on when the next update will be released?

    #42313

    I don’t have any ETA for any update, sorry.

    #42363

    Thanks for the reply – I have one other question regarding Walk Forward testing. I am working on strategies at the moment that only BUY which obviously means they are out of the market when ever the market is falling. So my question is won’t these large gaps with no trading skew the Walk Forward results? If an out of sample period has no trades then surely it will make the results bad and negate the point of WF testing?

    #42365

    This is a good question. Walk Forward doesn’t take this into consideration, because we can’t never known in advance when the market will be in an uptrend or in a downtrend. The best we could do is make a lot of iterations, plays with different settings of  IS/OOS percentage. If your strategy doesn’t trade (or less) in OOS periods, the WFR should be not optimal (<50%). You can also adapt yourself the periods for IS/OOS, start the backtest at a date where you know your strategy is trading in IS and OOS..

    #42374

    I think for the WFA to be of value it is necessary that you have at least 30 trades in each iteration. Choosing a much shorter time window produces a lot of results that can be a result of just chance. Of course this is not always possible but in the best of all worlds… 🙂

Viewing 9 posts - 1 through 9 (of 9 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login