/// <summary> /// Subscribe to New Symbol for bar data /// </summary> /// <param name="barDataRequest"></param> public void SubscribeSymbol(BarDataRequest barDataRequest) { if (_classLogger.IsInfoEnabled) { _classLogger.Info("New subscription request recieved Request for " + barDataRequest, _type.FullName, "SubscribeSymbol"); } // Add new symbol to the Bar list if (!BarSubscriptionList.Contains(barDataRequest.Security.Symbol)) { BarSubscriptionList.Add(barDataRequest.Security.Symbol); } // Fetch data if its not already fetched for ticks if (!TickSubscriptionList.Contains(barDataRequest.Security.Symbol)) { // Use locally saved data if (_persistanceDataCount > 0) { var task = Task.Factory.StartNew(UseLocalData); _tasksCollection.Add(task); } // Fetch fresh data else { FetchData(barDataRequest); } } }
/// <summary> /// Subscribe to New Symbol for bar data /// </summary> /// <param name="barDataRequest"></param> public void SubscribeMultiSymbol(BarDataRequest[] barDataRequest) { if (_classLogger.IsInfoEnabled) { _classLogger.Info("New subscription request recieved Request for " + barDataRequest, _type.FullName, "SubscribeSymbol"); } for (int i = 0; i < barDataRequest.Length; i++) { // Add new symbol to the Bar list if (!BarSubscriptionList.Contains(barDataRequest[i].Security.Symbol)) { BarSubscriptionList.Add(barDataRequest[i].Security.Symbol); } } FetchData(barDataRequest); }
/// <summary> /// Subscribe to New Symbol for bar data /// </summary> /// <param name="barDataRequest"></param> public void SubscribeSymbol(BarDataRequest barDataRequest) { if (_classLogger.IsInfoEnabled) { _classLogger.Info("New subscription request recieved Request for " + barDataRequest, _type.FullName, "SubscribeSymbol"); } // Add new symbol to the Bar list if (!BarSubscriptionList.Contains(barDataRequest.Security.Symbol)) { BarSubscriptionList.Add(barDataRequest.Security.Symbol); } // Fetch data if its not already fetched for ticks if (!TickSubscriptionList.Contains(barDataRequest.Security.Symbol)) { FetchData(barDataRequest); } }