Optimize on historical period and project the results going forward?
Author: dsicking
Creation Date: 1/10/2011 6:42 PM
profile picture

dsicking

#1

I am struggling with selecting the best performance parameters to use in optimization (say comparing recovery factor optimization to pessimistic RR) and determining which run within an optimization represents the best option. I would like to first optimize a strategy over some historical period, say the period from 18 months to 6 months ago. Then I would like to project the results of each run in the results to the current time. The best alternative would be the one that gave the highest return in the forward prediction step. I can manually accomplish this goal, by resetting the time frame and manually clicking on each line in the results category. This is time consuming and manually recording the results for an objective comparison is painfully boring.

Am I missing some feature for automating this process or do I have to code this?


profile picture

Eugene

#2
The feature you're missing is a Walk Forward Optimizer which hasn't been created for WL6 yet.
profile picture

dsicking

#3
Is this a near term goal? Would it be worth my time to code it myself over the next couple of months?
profile picture

Cone

#4
I haven't it seen it being sized up yet, certainly not for 6.2 this summer.

fyi, WLP 6.1 should be out after the market today, but it's primarily bug fixes with a couple new features to work with opening prices. Also, you'll be able to set custom schedules for EOD run times in the Strategy Monitor.
profile picture

Eugene

#5
2 dsicking: fyi, the Optimizer API isn't going to make your life easy when it comes to tasks like walk forward analysis and/or speeding optimizations up by multi-threading.
profile picture

dsicking

#6
I'm not good enough with WL to code it inside of the program. I already tried this approach and concluded I needed major help to solve a host of problems. I would likely write a new code, perhaps outside of WL, that could read a saved results file from WL and do simple forward projection for each set of strategy input variables. My strategies are simple and can be coded fairly easily.

Would it be relatively easy to build a WL code that could do the second step of the walk forward. I think I could figure out how to read in a set of optimizer values and get WL to project it forward. My concern is making the code loop back to read the next line in the input file and resetting all of the internal variables. This shouldn't be hard, but I have failed to get it to work thus far.

Based on the limited manual walk forward work I have done, I think this process is important. I was quite surprised that the parameters I though most important, e.g. net profit, select net profit, etc, did not have much predictive power in the walk forward analysis. For my strategies, number of trades proved to have the greatest predictive power. This simple, but tedious effort of conducting a walk forward analysis changed my attitude toward optimization. Refining optimizer inputs to provide precise maximums seems to be a waste of time. Finding a broad range where backward projections always give a reasonable profit seems to be more important. Do these findings match your understanding?

BTW - I assume multi-threading is what we used to call parallel processing. If that is true, Eugene's comment would indicate that buying a machine with multiple processors would not be worth my money. Is that true? Does a 64 bit machine run optimizations much faster than a 32 bit machine? I am in need of more processing power and would like to hear your thoughts on what to buy.

profile picture

Eugene

#7
QUOTE:
BTW - I assume multi-threading is what we used to call parallel processing. If that is true, Eugene's comment would indicate that buying a machine with multiple processors would not be worth my money. Is that true?

Perhaps we should add this to one of the FAQs. Until Wealth-Lab 6.x is re-built for .NET 4.0, and I'm not sure when this uber-important milestone is scheduled to happen, true parallel processing in optimizations that speed up backtests by spreading the load on multiple CPU cores, is hardly going to happen - while we're on .NET 2.0/3.5+.
profile picture

mschneider

#8
I've tried to code something like this utilizing a SQL server:

After optimizing in WL I imported the data into SQL.
In SQL the next step was to convert the data into time frames. An example: The optimized-input were intraday-minute data from 1st July to 31st Dec. This data are assigned to various time frames: Week 40, Week41, Week42, ... and Month_July, Month_August, ... . This aggregation was consistent with the "Average" function in Wealth-Lab (comparing the same timeframe).
Next step was a) for each timeframe b) for each combination of parameters to get the best value (NetProfit, Win%, ...), this I put into a new table.
Now I could play games like "Use the best parameters of the last 3 months for the following month. Example: First query was to find the best value for July-Sept2010, use this parameter in October2010, find parameter for Aug-Oct10 and use them in Nov2010 and so on.
This I tested with 2,3,4,5... weeks, months to find out which timeframe gives me the best or reliable value for the future.

This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).