How Save Optimized Strategy Parameters to Code
Author: ronc
Creation Date: 12/29/2012 6:29 PM
profile picture

ronc

#1
I created a strategy using the drag-and-drop rules editor. I optimized the strategy using the genetic algorithm optimizer. But I cannot seem to save the resulting optimized parameters to the code. I right-clicked the optimal parameters to "Save these parameters as default for the strategy" in the optimizer window, and I clicked "Save Parameters" in the Strategy Parameters window, but the code still contains the original default values. The new/optimized values do appear in the Strategy Parameters window - but where are they stored and why are they not appearing in the code? How do I get them into the code so that I can then reuse and edit that code by hand? Using Wealth Lab Pro 6.4.52.
Thanks,
Ron
profile picture

Cone

#2
They're saved in the Strategy's xml file. When you want to use the optimized values, just enable the "PV" button in the lower right status bar of the Strategy Window.
profile picture

ronc

#3
Thanks Cone. Still confused though. I found another post on this topic and am able to get the optimized parameters into the code via this procedure:
1. optimize
2. choose row to examine
3. right click this row and press "Set these parameter values as default for the strategy"
4. right click this row and press "Assign Preferred Values to the selected symbol to this row"
5. Press "Go" and examine the chart for this parameter set
6. Now the PV button toggles between the "Saved Parameters" and the "Preferred Parameters"

This procedure seems to save the optimized parameters into the code, but only for the single symbol that I used in the optimization. I want to test the same parameter set on another symbol. If I select a symbol other than the one I used in optimization, the Strategy Params switch to values other than the optimized ones in the code. I have tried toggling the PV button, modifying one Strategy Param, but nothing seems to put the parameters into the Strat Param window so I can test with another symbol. I tried modifying a single param and the "Reset" in the Param window but that does not insert the optimized params either. How can one use the parameters in the code on any desired symbol?

Thanks,
Ron
profile picture

Eugene

#4
Why not just follow the source?

Wealth-Lab User Guide > Strategy Window > Optimization > Results > Preferred Values > "Assigning Preferred Variables"

It contains a how-to for every possible case.
profile picture

ronc

#5
Yes, I read that part of the documentation but still seem to be missing something. I am using raw profit single-symbol mode. I want to run simulations/optimizations and save a parameter set as the default for the strategy, so that I do not need to re-enter the parameters each time. In single-symbol mode "Assign Preferred Values to all Symbols from this Row" is disabled. "Assign Preferred Values to the selected Symbol from this Row" is enabled but it only seems to assign the values for the particular symbol that I used in the simulation. When selecting another symbol those defaults are lost. How do retain the parameters so that they will be used on any symbol or dataset? The cases in the documentation do not seem to cover that.

I thought it would be "Save ... as default" but that wiped out all of my other parameters. In other words, I had a large set of parameters, I removed those that I did not want the optimizer to touch (in the optimzation window), ran the optimization, chose the desired result set, and when I save that set as default it erased (from the code) those params that I did not use in the optimization. So I had to re-enter the code for all of those parameters.

Any help would be appreciated.

Thanks,
Ron
profile picture

Eugene

#6
QUOTE:
"Assign Preferred Values to the selected Symbol from this Row" is enabled but it only seems to assign the values for the particular symbol that I used in the simulation.

Which is pretty much reasonable and expected, since you're using single symbol mode.

QUOTE:
How do retain the parameters so that they will be used on any symbol or dataset?

To "Assign Preferred Values to all Symbols from this Row" (or "Assign PVs based on the highest/lowest average metric value for all symbols"), simply switch to portfolio backtest mode.
profile picture

ronc

#7
Thanks Eugene, but I am still stuck. In the left-hand pane, I am using Portfolio Simulation Mode for the optimization. "Assign Preferred ... to all Symbols" is not available (disabled). So I then backtested on the Dow 30 dataset, again in Portfolio Simulation Mode. Still the "Assign... to all Symbols" is disabled. Is there something else I need to do be in what you refer to as "portfolio backtest mode" so that "Assign ... to all Symbols" will be enabled? To clarify, I want to use the parameter set resulting from optimizing on a single symbol as the default for any symbol or dataset.
Thanks,
Ron
profile picture

Eugene

#8
Hi Ron,
QUOTE:
"Assign Preferred ... to all Symbols" is not available (disabled).

Because you have to highlight a row for the choices to become enabled. Then you'll be able to Assign PVs.
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).