コード例 #1
0
        public OkexStockMarketData getStockMarketDataToUsdt(OkexStockInstrumentType instrument)
        {
            string              str = getRequest.ticker(instrumentsToUsdt[(int)instrument]);
            JObject             jo  = (JObject)JsonConvert.DeserializeObject(str);
            OkexStockMarketData md  = JsonConvert.DeserializeObject <OkexStockMarketData>(jo["ticker"].ToString());

            return(md);
        }
コード例 #2
0
        public OkexStockMarketData getStockMarketData(OkexCoinType commodityCoin, OkexCoinType currencyCoin)
        {
            string              c0  = OkexDefValueConvert.getCoinName(commodityCoin);
            string              c1  = OkexDefValueConvert.getCoinName(currencyCoin);
            string              str = getRequest.ticker(c0 + "_" + c1);
            JObject             jo  = (JObject)JsonConvert.DeserializeObject(str);
            OkexStockMarketData md  = JsonConvert.DeserializeObject <OkexStockMarketData>(jo["ticker"].ToString());

            md.timestamp        = long.Parse((string)jo["date"]);
            md.receiveTimestamp = DateUtil.getCurTimestamp();
            return(md);
        }