Wealth-Lab (.NET) 5.0
Is there any way to use and call external .net dlls from WL5? For example System.Xml or MyNumberCruncher.dll?
Size:
Color:
Dave,
The assembly must be dropped in WL5 directory, then the usual using MyNumberCruncher line is added -- or are there strings attached?
Size:
Color:
Cool, thanks. Next question -- how to get intellisense going for it? I think I already know the answer -- write it in Visual Studio :P
Size:
Color:
P.S.
The assembly must be dropped in WL5 directory...
Try to copy System.XML.dll from:
%windir%\Microsoft.NET\Framework\v2.0.50727\
;)
Size:
Color:
Following up on this, how do I code my strategy entirely in my own dll and then call it?
I created a DLL with the following as the only class file
(and referenced the WealthLab DLLs from my DLL):
CODE:
Please log in to see this code.
I then copied this TestStrat.dll to the WL5 folder, and created the following script in WL5:
CODE:
Please log in to see this code.
When I hit compile I don't get a result. If I insert a typo into the TestStrategy class name (for example Test_Strategy) I get a compile error (as expected). But I don't get a message that it compiled successfully (or failed) when I hit compile, and when I hit "Run the strategy" it switches to the chart view (as if it ran the strategy) but nothing is printed in the debug window (if I add more code to the execute method that code doesn't execute either).
Thoughts?
Dave
Size:
Color:
First, an update on the original question - the ability to create references to .NET Assemblies is coming in Version 5.1.
<< how do I code my strategy entirely in my own dll and then call it? >>
A detailed answer is in the works here mainly with debugging instructions, but the easy answer to this is once you compile your dll and drop it in the WL5 folder...
1. Restart WLP5
2. Select your strategy from the Strategy Explorer.
That should be it.
Size:
Color:
2. Select your strategy from the Strategy Explorer.
I thought he should be additionally impementing StrategyHelper for that?
Size:
Color:
Yes, of course. Let me work up an example.
Size:
Color:
Here you go. There will be more details published later, including how to use this Helper with debugging. For now, just follow the lead and see the comments.
CODE:
Please log in to see this code.
Compile that, and drop the Assmbly (dll and pdb files) in the WL5 directory. Restart WL5.
Size:
Color:
Just a heads up, when I run a script in an external DLL the Performance tab is blank. If I then run it a second time I get a second Performance tab, and there's nothing in the tab (when there's only one it's an empty white results pane, when there are two the results pane is gone).
Note the trades are OK and the equity curve is also OK, so it's just the results pane. Is there any workaround for this or is this somehow caused by something bad I'm doing in my strategy (I tried it with a random entry generator that just enters and exits and got the same problem).
Dave
Size:
Color:
Hi Dave,
You seem to be doing about right in your code because I can confirm this sort of stuff is going on. Please create a support ticket.
Size:
Color:
OK, I'll create a ticket. It's not a pressing problem for me since I'm mostly running scripts in WL5 itself, but as people implement 3rd party script DLLs this is going to be an issue.
Dave
Size:
Color:
Dave, sorry but please could you re-open the ticket? Chances are it could take less time to fix than expected. Thank you.
Size:
Color:
I'll reopen it (users don't have that priveledge).
Size:
Color: