How do I put all strategy code in Visual Studio? Is there a template?
Author: skalman99
Creation Date: 3/18/2011 7:18 AM
profile picture

skalman99

#1
Hi

I'm looking to minimize the amount of code visible in the WL6 C# editor. Would like to have as much of the strategy code in Visual Studio as possible. Could anybody point me in the direction of an example of how to do this?

Thanks!

Jon Brewer
profile picture

Eugene

#2
Hi Jon,

The cycle of articles on debugging describes how to move the complete Strategy code to a Visual Studio solution:

Programming | How can I debug my trading strategies in Wealth-Lab?

Also: Wiki FAQ | Strategies and WealthScript > Is there a way to reuse a function in Strategies? Is it possible to create a library of reusable functions?

Hope this helps.
profile picture

skalman99

#3
Thanks Eugene for your speeedy reply! I will read the articles!

regards Jon
profile picture

skalman99

#4
Eugene,

Sorry, embarrasing question: I fall over on point 6 in first article. What does the helper class look like? Would it be possible for you to send me an example of the helper class? I'm new to C#... and having problems implementing the properties...


Regards Jon Brewer

"In the same source code file (or a different file if desired) create a new class derived from StrategyHelper. A StrategyHelper is required for each Strategy that you create. Wealth-Lab examines your assembly for the StrategyHelpers that it contains, and uses them to determine what Strategies to display and load. Name the helper class the same name as your Strategy's class name, with the word "Helper" appended. Use code completion to provide stubs for the required properties. The Strategy Helper class returns properties that describe details about the Strategy that are needed by Wealth-Lab. Implement the properties in the code of your helper class."
profile picture

skalman99

#5
...hold your horses... think I've got it...
profile picture

skalman99

#6
Got it running, find my strategy from WL and it runs! have no code visible in WL, in fact no Editor tab at all!
profile picture

Eugene

#7
QUOTE:
have no code visible in WL, in fact no Editor tab at all!

This is how it should be. Wealth-Lab's editor supports C#. But let's suppose that your language of choice was VB .NET when compiling the strategy library? What if you coded it in C++ or any other supported .NET language? Should Wealth-Lab act as ".NET Reflector"? Moreover, what if you have obfuscated the code so it has become (intentionally) unreadable, can't be restored back to a high-level language, and the only thing that's left is to show it as byte code (MSIL)? ;)

You get the picture. To sum it up, being able to restore source code from a compiled assembly is either unpractical, or impossible, and in some cases (read: when obfuscated) unwanted.
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).