Hi,
a code of mine needs to be executed on the symbol that was in the dataSet all the time in the test period. Until now I have hard coded that symbol in my code but I´d like to deal with this more flexible. Is there a componnt that already deals with finding that symbol in the selected dataset?
dansmo
Size:
Color:
FirstActualBar?
Size:
Color:
Hmm, in an evolving watchlist code it happens that symbols do not trade anymore and there wont be any new bars.
I think the code need to have a look at the date of the first and last bar of any symbol and compare that to the selected Data Range. If there are more symbols that fit that criteria the one with the most number of bars should be selected.
This would be a great feature for evolving watchlist codes, since these should be run on the symbol that was in the dataset all the time for the Data Range.
Is there a better way?
Size:
Color:
Why don't you just look for the symbol that has the oldest starting date AND the newest ending date? You'll only have to look once.
Even easier, just include an index, like the Dow 30 in your DataSet and click on that.
Size:
Color:
Like I said before: I have hard coded that symbol at the moment. But I want this to be more flexible.
So I need to have a function that is called at the beginning of the script to get the symbol.
Including an index is not an option since that would need more significant changes to my codes.
Size:
Color:
Do you agree that this is the solution?
Would it be possible to add this to Community.Components? A Method that returns the symbol string.
CODE:
Please log in to see this code.
Size:
Color: