COM objects in WLD 5
Author: gmcintire
Creation Date: 5/14/2009 9:17 AM
profile picture

gmcintire

#1
I am thinking of upgrading to WLD5, but I absolutely need something like the ExecuteScript OLE function of WLD4.
Does WLD5 have an equivalent method of starting WLD and executing scripts from an external program?
profile picture

Eugene

#2
WLD5 is capable of executing any equivalent method if it exists in .NET. In your case, the ExecuteScript analogue is called "COM Interop(erability)".

Edit: Hmm, seems like you want to do exactly the opposite thing. Starting WLD isn't a problem, and probably I could think of a way to executing strategies externally. But to answer, at first let me ask why would you want it?
profile picture

gmcintire

#3
Eugene,

Thanks for your answer.

I do want to do the opposite as you said. I want to have my program(in Perl) start WLD5 and run my scripts on my data. Since I live in Germany, this needs to happen in the middle of the night while I am asleep. I do this with WLD3 now.

In WLD3, I would use OLE to create a new WealthLab.WL3 object. Then I would call obj.WatchListSymbols("my watchlist") to get all the symbols from that watchlist. Then I would call obj.ExecuteScriptTimed("my chartscript", "my watchlist", "SYMBOL") for each symbol in the watchlist.

WLD3 provided these(and a few other) OLE functions precisely for this purpose. I did a search for ExecuteScript and found 73 entries, so it appears I am not the only one using this feature of WLD3.

It is a make or break issue for me since I need to have this 5 hour process completed by the time I wake up at 6:00AM German time(midnight EST), so I can enter my orders for the day.

It does not have to be OLE, but must be something I can call from perl to do this. My preference would be OLE with the exact same functions though. Change the WealthLab.WL3 to WealthLab.WL5 so I can keep WLD3 and WLD5 on the same computer without conflict.

But, I will settle for any relatively simple method of doing this.
profile picture

Eugene

#4
Frankly, what you've described is the job of the Strategy Manager tool -- to run strategies in different timeframes, with configured position sizing and linked to specific datasets -- to generate alerts.
profile picture

gmcintire

#5

Looking at the manual for the Strategy monitor, it does seem similar, but I see issues.

From the manual, it looks like the only way to activate it is to do a bunch of clicking on menus after WLD starts. This is what I am trying to avoid. I have used the mouse & keyboard macro programs before and they are notoriously unreliable.

I need something that can control this from my program. The program actually does several other things. Each night it first reboots the computer to start from a known environment. It then downloads data and converts to ascii. It does several verifications and then runs IndexLab. After that, it starts WLD3 and runs the chartscripts.

This is why I bought WLD3 years ago. This is the capability I need.

Above, you suggested... "probably I could think of a way to executing strategies externally."

What might that suggestion be? I'd really like to find a solution.
profile picture

Eugene

#6
QUOTE:
Above, you suggested... "probably I could think of a way to executing strategies externally."

Strategy Monitor is that solution designed to do its daily unattended job of downloading the data and running the strategy, once activated. It should serve as a thought-out replacement for legacy workarounds.

QUOTE:
What might that suggestion be? I'd really like to find a solution.

Yes, I could think of a more esoteric way at the possible price of reliability. WLD5 can probably be started with a 3rd party tool like a scheduler or scripting language, but then you would need to care about monthly authentication. Filling interactive dialog boxes isn't a big deal with modern tools e.g. AutoIt, so probably that shouldn't be a showstopper?

Next thing you need to know that there's an undocumented class called TradingSystemExecutor that does the dirty work behind the scenes. However, in my experience using it for some other task has been slightly problematic. Alerts are not available. :/ I'm not sure if the developers of Wealth-Lab have registered the library for COM Interop. After all, it doesn't make much sense since WLD5 is a fully managed .NET application. If they didn't, however, you probably could create a COM callable wrapper -- example, another one.

Having said that, I would not advocate it but instead would prefer to use the standard and easy way (i.e. Strategy Manager).
profile picture

gmcintire

#7
Eugene,

I'm liking your ideas here! I think you are understanding what I need.

What is the once a month authentication? I could probably do that manually if just once a month.

Looking at the COM examples, it does seem going to COM may be superfluous if .net can do the job.

I haven't used .NET enough to know how it would interface with WLD5.

Are you suggesting that I could write an external .net app in VB or C# and use it to control WLD5? That would be great if that is possible.

I would go for the easy way(Strategy Manager) if I can control it from an external program. Is that possible?
profile picture

Eugene

#8
Frankly, I haven't experimented yet with controlling SM from an external program.
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).