Optimization of a canned strategy taking over a day
Author: rdavis852
Creation Date: 5/26/2017 3:46 AM
profile picture

rdavis852

#1
I am currently running a Moving Average Crossover strategy and it is telling me that it will take over 24 hours. My PC has Win7(64), a quad processor and 8G of ram as well as .NET 4.0.

Task Manager tells me that the WL process(the only one running) is only using 25% of my CPU.
What is causing the program to run so slow and is there anything I can do to speed it up?

Support has told me that this is a common problem but searching the forum has not turned up any current posting. Any help would be appreciated.
profile picture

Eugene

#2
It's not a problem because it's not expected that Wealth-Lab would max out your CPU load at 100% even if it's a quad-core. As I suggested in the support ticket, this peculiarity has been discussed widely (here's some links just to prove my words)...

Question regarding Quad-Core support
Out of memory; Processing uses only one CPU core
Remaining Time of an Optimization is Too High
Dataset Optimization Slowing
Does WL use Hyper-Threading for calculations
Any plans for multicore support?
Is there a way to make strategy optimization multi-threaded?

...So I summed up our suggestions in this convenient Wiki FAQ (that I recommend you visit when you think you have a problem - chances are it's documented there with a solution or workaround):

Optimization is slow and takes much time. Is it possible to speed up?

Let's break them down:

1. Reduce the number of runs. It's the mother of all performance improvements. The canned "Moving average crossover" strategy has the step of 1. It would make more sense if you widen it to 5 or 10, if you were running an Exhaustive optimization (but you don't). After running a coarse optimization and finding out a robust parameter area, use a fine-grained optimization with the frequency of 1. For optimizers that support it, you could also disable unnecessary parameters using parameter checkboxes.

2. Monte Carlo optimization (that you're running) is faster and is OK to get a rough estimate but you're running it over the entire NYSE universe. That's thousands of stocks to process so if you're willing to load less historical data, consider doing it. Of course it will take up more time than to process a "Dow 30" kind of DataSet.

3. A poor man's optimization tip from the past was to launch two and more (up to the number of CPU cores) times WLP instances with the same strategy in different Windows accounts (usernames), tweaking the Strategy Parameters so that they don't overlap. It's visibly clumsy and no longer required since we have more powerful optimizers thanks to the Wealth-Lab community.

After we verify your WLP entitlement via a new support ticket, you'll have access to more potent optimizers available for download. They run faster than Exhaustive method but reach there in a manner different from MC optimizations: Genetic Optimizer (at least 30% faster than Exhaustive), Particle Swarm Optimizer (many times faster) and Exhaustive to Local Maximum Optimizer (typically reaches same results as exhaustive optimization in a fraction of its time - 10-20x faster).

profile picture

rdavis852

#3
Thank you so much for the links. I'll take a look at them. I didn't mean to imply there were none - I just could not find them. I hoped by mentioning it someone else would send me a link or 2.

As to the cpu utilization, I guess I would expect it to use all of the CPU if it was available. I'll try your work around....thx. Any plans in the future to change this? I was going to dedicate a machine to Wealth-Lab but might have to rethink that.
profile picture

Eugene

#4
QUOTE:
Any plans in the future to change this?

None than I'm aware of.

P.S. Your best bet is either the Particle Swarm Optimizer or the "Exhaustive to Local Maximum" optimizer.