Beispiel #1
0
        public static Depth GetDepth(BtcePair pair)
        {
            string queryStr = string.Format("https://btc-e.com/api/2/{0}/depth", BtcePairHelper.ToString(pair));

            try
            {
                return(Depth.ReadFromJObject(JObject.Parse(WebApi.Query(queryStr))));
            }
            catch (Exception e)
            {
                return(null);
            }
        }
Beispiel #2
0
        public static Depth ReadFromJObject(JObject o)
        {
            var r = new Depth();
            r.Asks = new List<OrderInfo>();
            r.Bids = new List<OrderInfo>();

            foreach (var item in o["asks"] as JArray)
            {
                var order = OrderInfo.ReadFromJObject(item as JArray);
                r.Asks.Add(order);
            }
            foreach (var item in o["bids"] as JArray)
            {
                var order = OrderInfo.ReadFromJObject(item as JArray);
                r.Bids.Add(order);
            }

            return r;
        }
Beispiel #3
0
        public static Depth ReadFromJObject(JObject o)
        {
            var r = new Depth();

            r.Asks = new List <OrderInfo>();
            r.Bids = new List <OrderInfo>();

            foreach (var item in o["asks"] as JArray)
            {
                var order = OrderInfo.ReadFromJObject(item as JArray);
                r.Asks.Add(order);
            }
            foreach (var item in o["bids"] as JArray)
            {
                var order = OrderInfo.ReadFromJObject(item as JArray);
                r.Bids.Add(order);
            }

            return(r);
        }
Beispiel #4
0
 public static Depth GetDepth(BtcePair pair)
 {
     return
         (Depth.ReadFromJObject(
              JObject.Parse(Query(string.Format("{1}api/2/{0}/depth", BtcePairHelper.ToString(pair), ExchangeHost)))));
 }
Beispiel #5
0
 public static Dictionary <BtcePair, Depth> GetDepth(BtcePair[] pairlist, int limit = 150)
 {
     return(MakeRequest <Depth>("depth", pairlist, new Func <JContainer, Depth>(x => Depth.ReadFromJObject(x as JObject)), new Dictionary <string, string>()
     {
         { "limit", limit.ToString() }
     }, true));
 }
Beispiel #6
0
        public static Depth GetDepth(BtcePair pair)
        {
            string queryStr = string.Format("https://btc-e.com/api/2/{0}/depth", BtcePairHelper.ToString(pair));

            return(Depth.ReadFromJObject(JObject.Parse(Query(queryStr))));
        }