public MakeCandlesFromBidAskForm()
        {
            InitializeComponent();
            try
            {
                quoteStorage = Contract.Util.Proxy.QuoteStorage.Instance.proxy;
            }
            catch
            {
                Logger.Error("Связь с сервером (IQuoteStorageBinding) не установлена");
                return;
            }

            histOnServer = quoteStorage.GetTickersHistoryStarts();
        }
        public MakeCandlesFromBidAskForm()
        {
            InitializeComponent();
            try
            {
                quoteStorage = Contract.Util.Proxy.QuoteStorage.Instance.proxy;
            }
            catch
            {
                Logger.Error("Связь с сервером (IQuoteStorageBinding) не установлена");
                return;
            }

            histOnServer = quoteStorage.GetTickersHistoryStarts();
        }
예제 #3
0
        public DateSpan GetServerTickerHistorySpan(string ticker)
        {
            var lastUpTime = lastUpdated.GetLastHitIfHitted();
            var needUpdate = !lastUpTime.HasValue || (DateTime.Now - lastUpTime.Value).TotalMinutes >= MinutesToRefreshTickerHistory;

            if (needUpdate)
            {
                try
                {
                    tickerFirstRecord = quoteStorage.GetTickersHistoryStarts();
                }
                catch (Exception ex)
                {
                    tickerFirstRecord = new Dictionary <string, DateSpan>();
                    Logger.Error("GetServerTickerHistoryStart() - ошибка получения истории", ex);
                }
            }
            DateSpan span;

            tickerFirstRecord.TryGetValue(ticker, out span);
            return(span);
        }