VB.Net 2003 - Is it possible to program WL 5 code
Author: MustPlayOptions
Creation Date: 7/18/2008 10:26 PM
profile picture

MustPlayOptions

#1
I'm very used to it and really don't feel like having to learn C# as I'm not a programmer so it's worse than pulling teeth to learn a new language. With the old WL I finally figured out how to send data between WL and a VB.Net program but am really confused now.

I saw the posts and directions on how to set up editing in VS 2005/8 for WL5 but I'm wondering if I can do all my programming in VB.Net 2003 or is the C# a requirement? I haven't seen/found any actual code in VB.Net, it all looked like C# to me. Will there be/are there examples of coding in VB.Net rather than the WL C# editor?

Thanks in advance,
MPO
profile picture

Eugene

#2
MPO,

Of course you can do your programming in any .NET language, and VB .NET not an exception, if your Strategy is in compiled form. Here's what WealthScript Guide has to say:

QUOTE:
Wealth-Lab Pro Version 5 is a technical analysis and trading platform in which you can express and test trading strategies in any .NET language. That's right. In the .NET Framework, all .NET languages compile to Intermediate Language (IL), so you can choose from more than 20 languages to work with.


QUOTE:
Will there be/are there examples of coding in VB.Net rather than the WL C# editor?


The same WealthScript Language Guide chapter from which I quoted, says:

QUOTE:
Wealth-Lab's Strategy Editor, however, comes with a C# compiler, and consequently the Strategy Builder generates code with C# syntax, so naturally we provide coding examples for C#.


If you have trouble understanding C# syntax, use any free online C#-to-VB converter like this:
Convert C# to VB
Or install SharpDevelop (also free) for offline translation.

In short, here's what you need to do:

1. Create a VB project for your class library.
2. Include required References to WealthLab.dll, WealthLab.Indicators.dll etc.
3. Create a class for your Strategy e.g. MyStrategy that implements WealthScript.
4. Create another class adding Helper to the StrategyName i.e. MyStrategyHelper implementing StrategyHelper.

CODE:
Please log in to see this code.


5. Right-click on the interface name and let Visual Studio generate all skeleton code for interface members.

CODE:
Please log in to see this code.


6. Code your Strategy and debug as explained below:

Ask Glitch - How can I debug my trading strategies in Wealth-Lab Pro 5?

Keep in mind that you'll not be able to use the Editor tab to manipulate your VB code.
profile picture

MustPlayOptions

#3
Thank you for the explanation. This is a good starting point since it's the first VB code I've seen for WL5. Between this and the other links I'll try and write a simple strategy. If I can figure it out I'll post the code here as an example although it might be a while because of my time constraints.

Thanks again,
MPO
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).