public static CandleData GetCandles(string instrumentName, string granularity)
 {
     var matches = _ratesDataSource._allCandles.Where((group) => group.UniqueId.Equals(instrumentName + granularity));
     if (matches.Count() == 1) return matches.First();
     // request the missing data
     var newGroup = new CandleData(instrumentName, granularity);
     _ratesDataSource._allCandles.Add(newGroup);
     return newGroup;
 }
        public static CandleData GetCandles(string instrumentName, string granularity)
        {
            var matches = _ratesDataSource._allCandles.Where((group) => group.UniqueId.Equals(instrumentName + granularity));

            if (matches.Count() == 1)
            {
                return(matches.First());
            }
            // request the missing data
            var newGroup = new CandleData(instrumentName, granularity);

            _ratesDataSource._allCandles.Add(newGroup);
            return(newGroup);
        }