/// <summary> /// Load data from the loader. /// </summary> /// <param name="begin">The beginning date.</param> /// <param name="end">The ending date.</param> public void Load(DateTime begin, DateTime end) { // define the starting point if it is not already defined if (this.StartingPoint == DateTime.MinValue) { this.StartingPoint = begin; } // clear out any loaded points this.Points.Clear(); // first obtain a collection of symbols that need to be looked up IDictionary <TickerSymbol, object> set = new Dictionary <TickerSymbol, object>(); foreach (TemporalDataDescription desc in this.Descriptions) { MarketDataDescription mdesc = (MarketDataDescription)desc; set[mdesc.Ticker] = null; } // now loop over each symbol and load the data foreach (TickerSymbol symbol in set.Keys) { LoadSymbol(symbol, begin, end); } // resort the points SortPoints(); }
/// <summary> /// Load one point of market data. /// </summary> /// <param name="ticker">The ticker symbol to load.</param> /// <param name="point">The point to load at.</param> /// <param name="item">The item being loaded.</param> private void LoadPointFromMarketData(TickerSymbol ticker, TemporalPoint point, LoadedMarketData item) { foreach (TemporalDataDescription desc in this.Descriptions) { MarketDataDescription mdesc = (MarketDataDescription)desc; if (mdesc.Ticker.Equals(ticker)) { point.Data[mdesc.Index] = item.Data[mdesc.DataType]; } } }