Sample file for debugging a strategy with VS2010 ?
Author: schmiebe
Creation Date: 5/9/2013 2:10 PM
profile picture

schmiebe

#1
I would like to learn how to debug a strategy from Wealth-Lab Developer 6.4 (64-bit, English version) with VS2010 Prof (German version). Operating system: Windows 7 Ultimate 64 Bit

Therefore I took the source code from the WealthScript Programming Guide on page 4/5 and went through the steps described here: http://www2.wealth-lab.com/wl5wiki/kbAskGlitchDebug.ashx

Currently I face 2 problems:
1. When compiling the classlibrary I am getting 11 warnings.
They are all of the same type:
"The XML-comment for the public visible type or member "Wealth.Lab.Strategies.MyStrategy" is missing."
The next warning refers to "Wealth.Lab.Strategies.MyStrategy.FirstBarXDaysAgo(int)" and so on ....
(I translated the error message above to English, so the original error message in English might look a little bit different)
In case you want to test it, I added the source code at the end of this topic.

2. I try to open the Precompiled Strategy Library in Wealth lab. But it doesn't show in the File Dialog.
I opened the XML file of the strategy to see its content.
Here it is:
<?xml version="1.0"?>
<doc>
<assembly>
<name>ClassLibrary3</name>
</assembly>
<members>
</members>
</doc>

But in case of a precompilated strategy, does the File Dialog really look for the XML file?

In the folder there are the following files:
05/09/2013 07:23 PM 5,632 ClassLibrary3.dll
05/09/2013 07:23 PM 13,824 ClassLibrary3.pdb
05/09/2013 07:23 PM 138 ClassLibrary3.XML
04/02/2013 11:20 AM 60,928 Fidelity.Components.dll
06/24/2008 03:56 PM 270,336 log4net.dll
04/02/2013 11:21 AM 782,336 WealthLab.dll
04/02/2013 11:21 AM 198,144 WealthLab.Indicators.dll


Can you help me to find a solution to those 2 problems above ?
Or could I get a sample file which I can do some testing with ?


Thanks.

CODE:
Please log in to see this code.
profile picture

Eugene

#2
1 - You inadvertently enabled XML comment generation in Visual Studio, and since you did not intend to provide XML comments to your code, VS errors out. Double click on your project's properties, switch to Build view, uncheck "XML documentation file".

2 - Precompiled strategies are not "opened"; they're always present. You have to put the ClassLibrary3.dll file into WL's main folder under Program Files and restart Wealth-Lab. The Wiki articles on debugging contain suggestion on setting Output path so to avoid doing it every time.
profile picture

schmiebe

#3
Thank you for the quick answer.

Problem number 1 is solved. You were right.

Problem number 2 still remains.
I didn't set the output path to the program folder right away, because there were error messages
coming up. The security settings of the program folder didn't allow VS2010 to write the files to
that location. This is solved now. I can choose which ever folder I want.

But it doesn't seem to matter where I write the files. I tried all the folders on the way from
C:\Program Files\MS123 to C:\Program Files\MS123\Wealth-Lab Developer 6\Data\Strategies.
When opening the strategies (File / Open Strategies) there is no strategie with a special icon,
which I could select.
There are only the standard strategie folders.
But the folders I see are not those from the WL main folder.
The folders I see are stored in:
C:\Users\trader\AppData\Roaming\Fidelity Investments\WealthLabDev\1.0.0.0\Data\Strategies
But writing the files to that folder doesn't help neither.

VS2010 seems to work. I selected "Attach to Process" from the debug menu and selected the
WealthLabDev.exe file afterwards.

I even started Wealth-Lab and VS as administrator, but it didn't help.

Which folder shall I choose for the VS2010 files ?
Or am I doing something else wrong ?


profile picture

Eugene

#4
The correct folder to install a compiled Strategy library is C:\Program Files\MS123\Wealth-Lab Developer 6 * -- that is, the Wealth-Lab installation folder. Strategy library is an extension. And as you might have noticed, all downloaded extension files are stored there.

* or "C:\Program Files (x86)\MS123\Wealth-Lab Developer 6" for 32-bit WLD on 64-bit Windows
profile picture

schmiebe

#5
I hoped C:\Program Files\MS123\Wealth-Lab Developer 6 would not be the right folder.

When the .dll file is in that folder, Wealth-Lab doesn't start anymore.

There is an error message coming up: "WealthLabDev has stopped working"

And in a new window: "Do you want to send more information about the problem? ...."
There are 3 files mentioned which store information concerning the error:
C:\Users\trader\AppData\Local\Temp\WER1065.tmp.WERInternalMetadata.xml
C:\Users\trader\AppData\Local\Temp\WER29B0.tmp.appcompat.txt
C:\Users\trader\AppData\Local\Temp\WERD7CA.tmp.mdmp

I added the first 2 files below.

There seems to be a problem with the "System.NotImplementedException" in the source code.

After deleting "classlibrary3.dll" from the folder, WealthLab can be started again.
profile picture

Eugene

#6
Leaving a NotImplementedException will lead to crash. You have to implement all these methods before trying to use the library.

A fully functional sample exists at: Home - Strategies.ActiveTrader - available after registration in the Wiki and manual enabling the ability to download attachments in your account (won't take long).
profile picture

schmiebe

#7
The sample project was exactly what I have been looking for.

I modified the methods in my project and the debugging worked right away.

Thank you a lot for the support.
profile picture

Eugene

#8
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).