Can't reset Strategy Parameters: still show old value
Author: ronc
Creation Date: 2/9/2013 5:57 PM
profile picture

ronc

#1
I edited the default value of a strategy parameter in my code. The Strategy Parameters window, however, shows a different number for that parameter. I have read in other posts that the Strategy Parameters window shows values from an XML file, but how do we control the values in that file? I have tried the following to get the parameter value from the code to appear in the Strategy Params window:
- compiled
- saved
- closed and reopened file
- moved the slider bar for the parameter, the hit Reset in Param Window
- clicked the parameter, typed in another value, then OK, then Reset in Param Window
- switched from Portfolio Simulation Mode to Raw Profit Mode, and back
- switched between stock symbols, and to a folder of symbols
Yet the Strategy Parameters window still shows an old value.
What is the secret?

The same parameters that appear in the Strategy Parameters Window also appear in the Strategy Window > Strategy Summary tab. But they are not the parameters in my code.

I have gone through all of the documentation and forum posts I can find. The documentation describes Preferred Values, but there is no PV button visible, so the PVs should be the values in the code, according the the WealthLab User Guide.

This is a big problem since my understanding is that tests are run with the values in the Strategy Parameters window, and not the values in the code. I supposed I could manually change each value in the Window to match what is in my code, but that seems a bit crazy.

Any help would be appreciated. Have spent days trying to figure this out, with the result of only more grey hair.

Thanks in advance.
profile picture

Eugene

#2
Check this out:

FAQ | Strategies and WealthScript > Why am I unable to "Reset" and "Save parameters"

QUOTE:
Because the default setting of the parameter value(s) may have been altered by "Save Parameters". In this case, the saved setting overrides the default value in the Editor. To set a new default parameter value, change a slider and Save.


So, this is very simple:

1. Drag a slider to step away from the saved strategy parameter values,
2. Find a new default combination that satisfies you,
3. Save. Voila.

Don't hit Reset because that takes you to the new default setting of the parameter value(s) that was created by "Save Parameters". Note that it overrides your code-based default values! The new default values are saved in the strategy's XML file under the <ParameterValues /> tag.

QUOTE:
The documentation describes Preferred Values, but there is no PV button visible, so the PVs should be the values in the code, according the the WealthLab User Guide.

If the PV button is not visible, no PVs have been assigned yet in the Optimizer tool.
profile picture

ronc

#3
In your step 2 above, you wrote that I should find a new default combination. I have that default combination as the default values in my code, e.g.:

CODE:
Please log in to see this code.


I have many such parameters in the code. Do I need to manually adjust all of those parameters in the Strategy Parameters window to match the values in my code? I have quite a few parameters. Is there not a way to get the parameter values from my code to be the new defaults in the Strategy Parameters Window, without having to manually enter all of them again? If not, it seems that every time I change a default in my code I also have to make the same change manually in the Strategy Parameters Window?

Thanks,
Ron
profile picture

Eugene

#4
Your saved parameter set overrides the default. Drag a slider, change to your code-based default values, save. Case closed.
profile picture

ronc

#5
To confirm my understanding, there are 3 sets of parameters:
- parameter values in the code
- parameter values in the Strategy Window
- parameter values that were saved from the Strategy Window
Correct?

If so, then is it also correct that when I want to change default parameter values in the code then I need to change each parameter in 2 places:
1) change the parameter values in the code, and
2) change the same parameter values in the Strategy Parameters window, and click Save.

I understand that the saved values from the Parameters window override those in the code, but what I am looking for is how to edit the values in the code and have those updated values be the new defaults. It seems like there is no way to do that, i.e. I need to also change the values in the S.P. window, correct?
profile picture

Eugene

#6
This is incorrect. "Save parameters" creates 2nd set of values, saved in the <ParameterValues> tag of the Strategy's XML file, that overrides parameter values saved in the code. This was the design. To reset it, drag a slider, change to your code-based default parameter values, and Save parameters again. Hope that helps.
profile picture

ronc

#7
Thanks Eugene. Is there a fast way to remove all Preferred Values that have been set for a symbol? Can I edit the strategy XML file or is there a way to do it via the UI?
profile picture

Eugene

#8
Not Preferred Values, but default Strategy Parameters. See the difference?

Directly editing the strategy's XML file is possible. The tag to remove is in my reply above, and the User Guide > Data answers the question "where's the file?". Since the change won't take effect until you restart WL, this way is not necessarily the fastest - and unsupported.
profile picture

ronc

#9
I guess I am still confused. My understanding is that Preferred Values are sets of values for the Strategy Parameters. What I am trying to do is to get rid of the Preferred Values that have been set for symbols. I have not clicked Save Parameters. The PVs were set as a result of optimization -> set preferred values for this symbol. But often I want to erase those PVs and just use the default parameter values that are in my code. My understanding from the above is that to do so I need to manually edit each value in the Strategy Parameter window, for each symbol, to make them match the values in my code (and then save). Is there no easier way?
Thanks.
profile picture

Eugene

#10
According to your first post, there is no PV button visible, so the PVs are not in effect.

Copy the Strategy code and paste in a new window. Edit the default parameter values in its constructor to taste. Then "Save As" under a new name. Hope that helps.
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).