- ago
How do I pass the ticker/symbol to this function from the idx loop?

searchString would be the ticker/symbol

CODE:
static bool DoesDataMeetCriteria(Dictionary<int, Tuple<string, DateTime>> data, string searchString, DateTime currentDate)       {          return data.Any(item => item.Value.Item1.Contains(searchString) && (currentDate - item.Value.Item2).TotalDays <= 10);       }


Thank you.
0
112
Solved
2 Replies

Reply

Bookmark

Sort
- ago
#1
I'm not sure I understand the question. Is this running in PreExecute or Execute? Would the answer be:

CODE:
string searchString = bars.Symbol;
I don't understand why you're using a Tuple instead of a BarHistory for your Dictionary argument? Is it to speed up the search? I suppose using the Tuple (storing by value) would make the Dictionary more compact so there would be less memory to search through (than using a BarHistory based Dictionary).
0
Best Answer
- ago
#2
Yup. Just could not find it .. I could find bars.SecurityName and bars.SecurityType in the autcomplete.

Thank you.

1

Reply

Bookmark

Sort