In normal use, one can set the Base Symbol by simply clicking on a symbol in the DataSet window.
However, in my Visual C# strategy, I would like to be able to SET this symbol at the beginning of the Execute() method. Is this possible?
Even more important would be to be able to set the following parameters by program:
Scale
Data Range (several parameters)
Position Size (several parameters)
Size:
Color:
First, let's determine what kind of task - not covered by normal usage of SetContext/RestoreContext - are you trying to accomplish with this?
Size:
Color:
Let's say you have several strategies programmed in Visual C#, each is only valid for a certain Base Symbol, a certain scale, data range and position size.
Now when I start one of these strategies from the .Net environment, WL6 opens the default workspace with its predefined Base Symbol, etc. regardless of what strategy I am using.
The problem would also be solved when I could tell WL6 which workspace to load upon starting a strategy from .Net. But I don't think that this is possible.
Size:
Color:
Thanks for the clarification.
The problem, I hope, will be solved by instructing Wealth-Lab to keep the current configuration in the Strategy's XML file when saving a strategy:
Preferences dialog (F12) > Advanced Options > Strategy-Dependent Preferences
Size:
Color:
Thank you for your answer.
However I can't find
Strategy-Dependent Preference within Advanced Options of Preferences
Size:
Color:
Size:
Color:
In my particular case this does not help, as in fact I have only one single strategy that handles all. This "Master-Strategy" reads an external XML file which contains instructions about which external symbols, indicators, panes, parameters etc. are used for the run. Hence my strategy dll that is read by WL6 contains only one strategy.
As I said before, WL6 loads the default workspace when started by .Net. However, if I make corrections to the C# program without closing WL6, which is possible by setting breakpoints and making changes after the program stopped at the breakpoint, then I can close the current workspace and reopen whatever workspace I want and get the right base symbol, data range etc. stored therein. But this is only a workaround.
This brings me back to my initial question which is still unanswered: Is it possible to set the base symbol, scale, data range and position size by program ?
Size:
Color:
Setting the base symbol and so forth programmatically is not supported.
Regarding Default workspace, I probably did not understand your description quite well. For sure, multiple copies of the same Strategies can be saved in Default workspace and individual Strategy windows would open up on different symbols just fine (without having to resort to workarounds like saving copies of your master Strategy with different settings, it works out of the box).
Size:
Color: