Exemplo n.º 1
0
        /// <summary>
        /// More detailed request to retrieve candles
        /// </summary>
        /// <param name="request">the request data to use when retrieving the candles</param>
        /// <returns>List of Candles received (or empty list)</returns>
        public static async Task <List <Candle> > GetCandlesAsync(CandlesRequest request)
        {
            string requestString = Server(EServer.Rates) + request.GetRequestString();

            CandlesResponse candlesResponse = await MakeRequestAsync <CandlesResponse>(requestString);

            List <Candle> candles = new List <Candle>();

            candles.AddRange(candlesResponse.candles);

            return(candles);
        }
Exemplo n.º 2
0
        /// <summary>
        /// More detailed request to retrieve candles
        /// </summary>
        /// <param name="request">the request data to use when retrieving the candles</param>
        /// <returns>List of Candles received (or empty list)</returns>
        internal static List <Candle> GetCandles(CandlesRequest request)
        {
            string requestString = Server(EServer.Rates) + request.GetRequestString();

            var candles = new List <Candle>();

            CandlesResponse candlesResponse = MakeRequest <CandlesResponse>(requestString);

            candles.AddRange(candlesResponse.Candles);

            return(candles);
        }
Exemplo n.º 3
0
        /// <summary>
        /// More detailed request to retrieve candles
        /// </summary>
        /// <param name="request">the request data to use when retrieving the candles</param>
        /// <returns>List of Candles received (or empty list)</returns>
        public List <Candle> GetCandles(CandlesRequest request)
        {
            var requestString = EndpointResolver.ResolveEndpoint(_environment, Server.Rates) + request.GetRequestString();

            var candlesResponse = MakeRequest <CandlesResponse>(requestString);

            var candles = new List <Candle>();

            if (candlesResponse != null)
            {
                candles.AddRange(candlesResponse.candles);
            }

            return(candles);
        }
Exemplo n.º 4
0
        /// <summary>
        /// More detailed request to retrieve candles
        /// </summary>
        /// <param name="request">the request data to use when retrieving the candles</param>
        /// <returns>List of Candles received (or empty list)</returns>
        public static List <Candle> GetCandles(CandlesRequest request)
        {
            string requestString = Credentials.GetDefaultCredentials().GetServer(EServer.Rates) + request.GetRequestString();

            CandlesResponse candlesResponse = MakeRequest <CandlesResponse>(requestString);
            List <Candle>   candles         = new List <Candle>();

            if (candlesResponse != null)
            {
                candles.AddRange(candlesResponse.candles);
            }
            return(candles);
        }