示例#1
0
        public List <TickerInformation> GetTickers()
        {
            TickResponse response = kucoinClient.GetTickers();

            List <TickerInformation> result = new List <TickerInformation>();

            foreach (TickDetail tick in response.Data)
            {
                TickerInformation tickerInfo = new TickerInformation()
                {
                    Ask               = tick.Buy,
                    Bid               = tick.Sell,
                    Last              = tick.LastDealPrice,
                    Open              = tick.LastDealPrice,
                    Low               = tick.Low,
                    High              = tick.High,
                    Volume            = tick.Volume,
                    VolumeQuote       = tick.VolValue,
                    TimestampOpen     = tick.Datetime,
                    DateTimeOpenOrig  = tick.Datetime.ToString(),
                    TimestampClose    = tick.Datetime,
                    DateTimeCloseOrig = tick.Datetime.ToString(),
                    Symbol            = tick.Symbol
                };

                result.Add(tickerInfo);
            }

            return(result);
        }
示例#2
0
        public List <TickerInformation> GetTickers()
        {
            Statistics24HourResponse response = binanceClient.GetTickers();

            List <TickerInformation> result = new List <TickerInformation>();

            foreach (Statistics24HourDetail detail in response)
            {
                TickerInformation tickerInfo = new TickerInformation()
                {
                    Ask               = detail.AskPrice,
                    Bid               = detail.BidPrice,
                    Last              = detail.LastPrice,
                    Open              = detail.OpenPrice,
                    Low               = detail.LowPrice,
                    High              = detail.HighPrice,
                    Volume            = detail.Volume,
                    VolumeQuote       = detail.QuoteVolume,
                    TimestampOpen     = detail.OpenTime,
                    DateTimeOpenOrig  = detail.OpenTime.ToString(),
                    TimestampClose    = detail.CloseTime,
                    DateTimeCloseOrig = detail.CloseTime.ToString(),
                    Symbol            = detail.Symbol
                };

                result.Add(tickerInfo);
            }

            return(result);
        }
        public List <TickerInformation> GetTickers()
        {
            TickerInfoResponse response = hitbtcClient.GetTickers();

            List <TickerInformation> result = new List <TickerInformation>();

            foreach (TickerInfoDetail ti in response)
            {
                DateTime parsedDate = DateTime.Parse(ti.Timestamp);
                string   str        = Helpers.GetServerTimeTicks((int)DateTicksType.Epoch, parsedDate);
                Int64    timestamp  = Convert.ToInt64(str) /* + parsedDate.Millisecond*/;
                //Int64 timestamp = Convert.ToInt64(str);

                //Debug.WriteLine(String.Format("originalDate = {0} parsedDate = {1} timestamp = {2}", ti.Timestamp, parsedDate, timestamp));

                TickerInformation tickerInfo = new TickerInformation()
                {
                    Ask               = ti.Ask,
                    Bid               = ti.Bid,
                    Last              = ti.Last,
                    Open              = ti.Open,
                    Low               = ti.Low,
                    High              = ti.High,
                    Volume            = ti.Volume,
                    VolumeQuote       = ti.VolumeQuote,
                    TimestampOpen     = timestamp,
                    DateTimeOpenOrig  = ti.Timestamp,
                    TimestampClose    = timestamp,
                    DateTimeCloseOrig = ti.Timestamp,
                    Symbol            = ti.Symbol
                };

                result.Add(tickerInfo);
            }

            return(result);
        }