What is the scope of data set and selected symbol?
Author: sourkraut
Creation Date: 4/2/2011 10:39 AM
profile picture

sourkraut

#1
Sorry if this has been asked and ansered, but I get "0 results" on searches for "scope" or "Execute()" method in titles, and searching the content is not really practical, since most bits of code contain the Execute method, and returns of scope in content are too numerous and have nothing to do with what I need. Nor does searching for parameter bring anything useful.

I would like to select a second security from the current data set via a slider. Toward that end I'd like to use the current DataSetSymbols.Count as maximum for the slider.
But the scope of DataSetSymbols.Count appears to be limited to the Execute() method.

Is there a way to access the current data set at the same scope as the slider definition?
The following code extract generates an error: "requires an object reference" (int maxSym ...)

CODE:
Please log in to see this code.


What am I doing wrong?

TIA


Eb
profile picture

Eugene

#2
This will not work.

But it's easier than you think. After creating the StrategyParameter and initializing with dummy values, just modify its properties in Execute():
CODE:
Please log in to see this code.
profile picture

sourkraut

#3
Thanks very much, Eugene.
That's just what I wanted.
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).