Exemplo n.º 1
0
        public TradesReply GetTrades(int count, IEnumerable <string> instruments)
        {
            if (count <= 0)
            {
                throw new ArgumentOutOfRangeException("count");
            }

            count = Math.Min(count, 2000);

            var res = new TradesReply();

            var instrs = instruments.Join("-");
            var args   = "trades/{0}?limit={1}&ignore_invalid=1".Put(instrs, count);

            JsonConvert.PopulateObject(MakePublicRequest(args), res.Items);

            // заполним имена инструментов
            foreach (var e in res.Items)
            {
                foreach (var i in e.Value)
                {
                    i.Instrument = e.Key;
                }
            }

            return(res);
        }
Exemplo n.º 2
0
		public TradesReply GetTrades(int count, IEnumerable<string> instruments)
		{
			if (count <= 0)
				throw new ArgumentOutOfRangeException("count");

			count = Math.Min(count, 2000);

			var res = new TradesReply();

			var instrs = instruments.Join("-");
			var args = "trades/{0}?limit={1}&ignore_invalid=1".Put(instrs, count);
			JsonConvert.PopulateObject(MakePublicRequest(args), res.Items);

			// заполним имена инструментов
			foreach (var e in res.Items)
			{
				foreach (var i in e.Value)
					i.Instrument = e.Key;
			}

			return res;
		}