Example #1
0
        protected override async Task GetTickersImpl()
        {
            var pairs = string.Join("-", ValidPairs.Select(x => x.Symbol));

            if (pairs.Count() < 1)
            {
                return;
            }
            var resultTickers = await client.GetTickerAsync(pairs).ConfigureAwait(false);

            if (resultTickers.Success)
            {
                GetTickersElapsed = resultTickers.ElapsedMilliseconds;
                var tickers = resultTickers.Data.Select(ToPriceTicker);
                var bars    = await Get24hrBars(pairs).ConfigureAwait(false);

                if (bars.Count != 0)
                {
                    tickers = tickers.Join(bars, x => x.Symbol, x => x.pair, Join);
                }
                ProcessPriceTicker(tickers);
                UpdateStatus(ServerStatus);
            }
            else
            {
                UpdateStatus(ServerStatus, $"GetTickers: {resultTickers.Error.ToString()}");
            }
        }
Example #2
0
        protected async Task GetTickers()
        {
            var pairs = string.Join("-", ValidPairs.Select(x => x.Symbol));

            if (pairs.Count() < 1)
            {
                return;
            }
            var resultTickers = await client.GetTickerAsync(pairs).ConfigureAwait(true);

            if (resultTickers.Success)
            {
                GetTickersElapsed = resultTickers.ElapsedMilliseconds;
                var tickers = resultTickers.Data.Select(ToPriceTicker);
                ProcessPriceTicker(tickers);
            }
            else
            {
                Status = $"GetTickers: {resultTickers.Error.ToString()}";
            }
        }