public static List <Types.Quote> GetQuoteList(string name)
 {
     if (quoteList == null)
     {
         DataFeedProcessor.GetFeed();
         return(null);
     }
     lock (quoteList)
     {
         return(quoteList.Where(x => x.Symbol.Name == name || x.Symbol.Feed1ShortName == name || x.Symbol.Feed2ShortName == name).ToList <Types.Quote>());
     }
 }
Example #2
0
        private void OrderFeedSubscriberTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            try
            {
                var assets = DataProvider.GetAssets();
                if (DoesResetTempExoirt)
                {
                    //var timestamp = DataProvider.GetCurrentTimestamp();
                    var expiryList = DataProvider.ExpiryList.Where(x => x.ExpiryTimestamps > DataProvider.GetCurrentTimestamp()).ToList <ExpiryTime>();
                    if (expiryList != null && expiryList.Count > 0)
                    {
                        if (DoesResetTempExoirt)
                        {
                            tempLastExpiry      = expiryList.FirstOrDefault <ExpiryTime>();
                            DoesResetTempExoirt = false;
                        }

                        if (tempLastExpiry != null && (((tempLastExpiry.ExpiryTimestamps / 1000) - AppGlobals.Instance.SettlementPriceDuration[OptionType.Classic][0]) <= (DataProvider.GetCurrentTimestamp() / 1000)) && !IsSubscribed)
                        {
                            DoesResetTempExoirt = false;
                            IsSubscribed        = true;
                            //TaskFactory.Task
                            DataFeedProcessor.GetFeed();

                            //isupdated = false;
                        }
                        else if (tempLastExpiry != null && (((tempLastExpiry.ExpiryTimestamps / 1000) + AppGlobals.Instance.SettlementPriceDuration[OptionType.Classic][0]) <= (DataProvider.GetCurrentTimestamp() / 1000)) && IsSubscribed)
                        {
                            IsSubscribed = false;
                            DataFeedProcessor.StopFeed();
                            //DoesResetTempExoirt = true;
                            tempLastExpiry = DataProvider.ExpiryList.Where(x => x.ExpiryTimestamps > DataProvider.GetCurrentTimestamp()).FirstOrDefault <ExpiryTime>();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
        }