Exemplo n.º 1
0
        static void Main(string[] args)
        {
            IConnector bc         = new BinanceConnector();
            var        pingResult = bc.TickerAllPrices().Result;


            var tickerResult = bc.TickerAllPrices().Result;

            Console.WriteLine($"Ping result:{pingResult}");
        }
Exemplo n.º 2
0
        private IEnumerable <Price> GetAllPrices(IEnumerable <Market> allMarkets,
                                                 DateTime requestDate)
        {
            var tickerResult = BinanceConnector.TickerAllPrices().Result;

            return(from market in allMarkets
                   from ticker in tickerResult
                   where market.Name == ticker.Symbol
                   select new Price()
            {
                MarketId = market.Id, Value = ticker.Price, Date = requestDate
            });
        }
Exemplo n.º 3
0
        /// <summary>
        /// First initialize collections of assets and markets
        /// </summary>
        /// <returns></returns>
        public async Task MarketCollectionInitialize()
        {
            var tickerResult = await BinanceConnector.TickerAllPrices();

            var allSymbols = tickerResult.Select(i => i.Symbol).ToList();

            var newAssets = DefineNewAssets(allSymbols);

            AssetRepository.Save(newAssets);

            var newMarkets = DefineNewMarkets(allSymbols);

            MarketRepository.Save(newMarkets);
        }