Hi
I have tried to access WL dll's from Excel and have used the search the forum tool to find out if this question has been asked.
I generate alerts from a combination of strategies. I then copy/paste them into excel where I have the ability to do further analysis and then "cherry pick" the alerts to get a shorter list of trades I want to take.
Is there a way (while keeping WL open and logged in to Fidelity) to take the ones I've picked and place the orders? This would be handy tool (for me at least ;->))
Size:
Color:
Regarding WealthLab.dll's members, whatever you can't find covered in the official documentation (i.e. the QuickRef and the Wiki Development Guide) is not supported. The aforementioned applies to accessing WL's DLLs in 3rd party apps. Finding their way around is entirely up to motivated developers.
Size:
Color:
I'm fine with that though in Excel VBA when I try to add a reference to WL dll's the messagebox popup says "Can't add a reference to the specified file".
Is there a reason why a reference can't even be made?
Size:
Color:
No idea. Try searching on VBA-specific resources instead.
Size:
Color:
Will do.
I understand what you're saying (mostly ;->)
QUOTE:
Regarding WealthLab.dll's members, whatever you can't find covered in the official documentation (i.e. the QuickRef and the Wiki Development Guide) is not supported. The aforementioned applies to accessing WL's DLLs in 3rd party apps. Finding their way around is entirely up to motivated developers.
Can I ask then before I go down some dead ends whether you think, in your professional opinion, whether it is possible to create a file of orders and get them to WL so they can be staged or placed?
Size:
Color:
Just create a Strategy that reads the file and places the orders. The only thing to be aware of is that exit orders require that you create a hypothetical position first.
Size:
Color:
Thanks Cone
Now I see it. That was dumb. Create a script called "GenerateOrders" which reads the symbol, shares, etc... Then BuyAtLimit etc....
Can the account be set and the order placed from within a script?
Appreciate the help. Apologies for being thick
Size:
Color:
Not from within a script. A Strategy can be associated with the account manually.
Size:
Color:
1. In your text file of Alerts, make sure each record indicates which account the trade should go to.
2. Create a copy of the strategy for each account. The only difference is that each strategy processes only the records for the specified account.
3. Assign the strategies to accounts using the Strategy Explorer (Ctrl+O)
Size:
Color:
Another possibility is to set the account in the Strategy's XML file, in case you prefer to generate it externally.
Size:
Color:
Thanks for the tips. I'll be doing some homework tonight!
Size:
Color:
I tried coding this but it generates alerts for every symbol in the dataset. Is there something obviously wrong here?
CODE:
Please log in to see this code.
Size:
Color:
Unless you attempt to run this DataSetSymbols looping code in multi-symbol backtest mode, no, it doesn't.
Size:
Color:
Read: "Only click on one symbol in the DataSet to run this script, any one symbol."
You can do this at least 3 different ways. But if you're just creating an Alert, the most efficient strategy would be to process each Alert as you read the record from the file...and that way you also run the script only once, on one symbol.
CODE:
Please log in to see this code.
Size:
Color:
Thank you for the help gentlemen.
The reason I am trying to do this is part of the discussion
hereIt's part of a broader strategy and this makes up one part of it.
Size:
Color:
Thanks Cone
Works like a charm. Only thing is now that I can generate the alert, I probably have to write a position sizer to read the same file for the number of shares. Is there a way to avoid that by setting or overriding the position size normally entered in the upper right corner of the strategy screen below the Data Range field? That way I could just trick the existing position sizer into generating an alert for the size I want and not have to write a new one?
Size:
Color:
Use SetShareSize() in your code and select the "WealthScript Override" option in the Position Sizing control.
Size:
Color:
Thank you Eugene. This helps a lot. You and Cone have helped me get up to speed pretty quickly.
I also now "get" DataSetSymbols-looping code versus Multi-Symbol Backtest code and see the ways to do what I need a lot quicker than my current execution and "loop" only once
Size:
Color:
One more question if I may,
Can "WealthScript Override" option be set in a script? (or more generally, can a position sizer be chosen on the fly, that is, there may be times when Pct Winners may be desired and other times, say, Kelly Criterion.
Size:
Color:
Yes, see Community.Components:
CODE:
Please log in to see this code.
I am stressing that this is unsupported.
Size:
Color:
Thanks!
When's the next version of Community Components coming out ;->);->)
Size:
Color:
Hello Eugene
You mentioned above with respect to an account
QUOTE:
Not from within a script. A Strategy can be associated with the account manually.
I am trading multiple accounts and want to make order entry easier.
My strategy is not fully automated as I get results from multiple strategies, screen them, and decide which trades to take.
I do this in Excel.
From Excel, I can generate a csv full of trades with position sizes and can read them and generate the alerts in WL.
[Many thanks to Cone]
Since I want to make the same trades (though not in the same share sizes) in multiple accounts, is there something you might suggest that would help automate the process?
Size:
Color:
Hello Steve,
Yes there is. To automate the process, get rid of Excel e.g. use Strategy Monitor.
P.S. Quoted text refers to the ability to mangle the <AccountNumber /> XML tag manually in a Strategy's XML file.
Size:
Color:
When you mentioned not from within a script, you never mentioned the XML tag until just now.
Actually "mangling" the <AccountNumber /> XML tag works beautifully, was trivial to implement, and easily gets what I needed done.
Thanks!
Steve
Size:
Color:
Eugene
I'm almost certain you are going to dislike this question but here goes ;->)
In the XML files I see the following tags
CODE:
Please log in to see this code.
How can I set it so the strategy always uses WealthScript Override (Set Share Size)?
I have a strategy I want to use this feature but when I open it, the strategy often uses the position sizer of the previously opened strategy and I want to force it not to do this.
I thought the 0 in <OverrideShareSize>0</OverrideShareSize> signaled False and tried 1 for True but that doesnt seem to be it
Thanks again
Size:
Color:
Steve,
Wealth-Lab's
ISettingsHost serializes boolean values as True and False.
OverrideShareSize is the parameter (number of shares), not a boolean.
Here's how it will work:
CODE:
Please log in to see this code.
Size:
Color:
Thanks a lot Eugene. I appreciate your help
Is there a place to learn more? I'm not familiar with ISettingsHost and would be interested in find out more about the XML tags
Size:
Color:
Even though that mode is set in the XML (<Mode>ScriptOverride</Mode>)
when I open the strategy, the Position Size is still using that of the previous strategy. Is there something I am doing incorrectly?
Size:
Color:
QUOTE:
I'm not familiar with ISettingsHost
Wiki > API >
Development Guide > Custom settings.
QUOTE:
and would be interested in find out more about the XML tags
You're welcome to explore this subject. As you understand it's undocumented and thereby unsupported.
Size:
Color:
Hello Eugene
As you know, I'm somewhat new to C# and have never worked with interfaces so I haven't quite got things to work but I think this is very close but not quite there
Can you take a quick look and see if something is obviously wrong? Thanks!
CODE:
Please log in to see this code.
Size:
Color:
Hi Steve,
By introducing the ISettingsHost interface, I just meant to clear a misconception regarding how Wealth-Lab serializes boolean values, but that's all.
I'm not sure what's the rationale behind trying to store the key/value pair for that myClass instance but you'll not get where you want with this.
If the XML hack didn't do the job, then I don't know else how to help you with this unsupported "hack". Sorry.
Size:
Color:
Ok I'll figure a workaround.
But let me ask this. If I save strategy1 and say, it uses positionsizer1, when I subsequently open strategy2 which was saved with a different position sizer, should the earlier open position sizer be displayed in WL? That is, strategy2 is now using the position sizer associated with strategy1 Is this normal behavior in WL?
Size:
Color:
It depends. See the Wealth-Lab User Guide > Preferences > Advanced Options > Strategy-Dependent Preferences.
Size:
Color: