I'm writing my first strategy and am struggling with something that seems ridiculous. I've added some securities in my portfolio, over which I'd now like to iterate.

public void OnData(TradeBars data) { foreach(KeyValuePair<string, string> pair in data) { // do something with entry.Value or entry.Key } }

which generates the bizarre error

Cannot convert type 'System.Collections.Generic.KeyValuePair' to 'System.Collections.Generic.KeyValuePair'

Um? Why is something so basic throwing errors?