Error in XML File after saving optimization results
Author: ronc
Creation Date: 9/4/2013 4:33 PM
profile picture

ronc

#1
I often save optimization results (in optimization results > right click > save results to file). Starting a few days ago, every time I do this, quit, and launch WLpro later I get an error message. The message appears after launching WL and before the WL UI appears.. The message:

"Strategy could not be loaded due to an error in the XML source file "C:\Users\....[path to results file]". The enclosing window says "Error Loading Strategies" in the window title bar.

If I click OK on the message I can load the strategy.

I have made various versions of the strategy by saving under different names but all produce this same error.

I tried copying and pasting the strategy source code into a new file and compiling and saving under a new name, but same error. So now every time WL launches I get an increasingly long error message listing all of my recent strategies (I create several per day).

WLPro version 6.5.20.0, 64-bit. Windows 7. All extensions are up to date.

Interestingly, after I load the strategy I can then go to Results and load the optimization results from the results file which WL said had an error.

Same issue arises using genetic and monte carlo optimization.

How do I fix this?

UPDATE: Even after deleting 2 of the strategies producing the errors, WLP still includes them in the error message saying that they cannot be loaded.
profile picture

Eugene

#2
It's interesting how you can save an immanently broken Strategy file from a blank window. Right off the bat, it's impossible to tell what's the culprit - let alone "how to fix". We'll need to go through a troubleshooting process to possibly reproduce the error.

At the bare minimum, we need to know:

1. What names did you give to those strategies (exactly)?
2. How is the DataSet called?
3. Complete, I mean absolutely unmodified, Strategy code that, by pasting into a blank window, produces an XML error after saving. It's remotely possible that something about its composition, coding style may trigger an error.

If all else fails, we might suggest to move to the support portal to acquire the entire Data/Strategies subfolder from "C:\Users\..." for troubleshooting.
profile picture

ronc

#3
To clarify, the window is not blank. After I click OK on the error message, WL finishes loading and then I can load the strategies.

Answers:

1. Strategy names: "151", "152", "dummy", "boo". I give my strategies integer names. I have strategies with numbers all the up to 152. The problem seemed to appear when I reached 151. "dummy" and "boo" were just test names I tried to see if there was some issue with the naming. I could not find any change in behavior with different names.

I went back and reran older strategies, specifically "37" and "55", ran optimizations on them, saved the results, and now these are broken too. They used to work OK. The problem occurs with all strategies, including ones that used to work.

2. DataSet names: This occurs with any dataset, regardless of the name. I originally observed it in a data set name "SP rand 186 shift" but I now observe it in all datasets.

3. Code: I created a new strategy based one of one your Wiki examples, ran it, saved optimization results, got the same error. Here is the code:

CODE:
Please log in to see this code.


Basically, this error appears at WLPro launch for any strategy with which I have saved optimization results, using any dataset. I do not know if this is related or not, but when I try to log in to Fidelity, it fails - I get a spinning cursor that never returns, and I have to force quit WL via Task Manager. Data Updates for Fidelity however are working.

Ron
profile picture

Eugene

#4
QUOTE:
this error appears at WLPro launch for any strategy with which I have saved optimization results


I think now I know what happens, and it's not about the code or strategy name.

Wealth-Lab prompts to save optimization results in a subfolder of this folder: ..\AppData\Roaming\Fidelity Investments\WealthLabDev\1.0.0.0\Data\. You must be saving optimization results in subfolders of the Strategies folder: the folder where strategies themselves are stored in XML files, organized in subfolders. Since optimization results are also stored in XML files (although in a different format), mixing them with Strategies' XML files would naturally cause issues after restart of WLP. WLP expects to load Strategy code from saved XML, but instead is being presented with unrecognized files (containing optimization results). Hence the warning message.

A power user or programmer like me would not attempt to save there, anticipating issues raised by mixing different XML files with incompatible structure, and would either change destination folder or create a new subfolder e.g. "OptimizationResults" (outside the Strategies subfolder, of course!) Ideally, WLP could prompt to save optimization results elsewhere (say, My Documents) to avoid incidents. Well, there's no such thing as "enough defensive design" as you can see.

Now that you know what not to do, you'll be fine after moving the improperly placed XML files elsewhere.
profile picture

ronc

#5
Yes, that fixed it.
Thanks!
profile picture

Eugene

#6
Glad to have helped.
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).