/// <summary> /// Returns candlestick chart data filtered by url parameters. /// </summary> /// <param name="pair"></param> /// <param name="startTime">Start of time range for data in epoch seconds</param> /// <param name="endTime">End of time range for data in epoch seconds</param> /// <param name="interval">Candlestick period in minutes Possible values are: 1, 5, 30, 60, 360, 1440</param> /// <returns></returns> public async Task <List <CandleStick> > GetCandleSticksAsync(string pair, int startTime, int endTime, int interval) { if (string.IsNullOrEmpty(pair)) { throw new ArgumentNullException(nameof(pair)); } if (startTime <= 0) { throw new ArgumentOutOfRangeException(nameof(startTime)); } if (endTime <= 0) { throw new ArgumentOutOfRangeException(nameof(endTime)); } if (interval <= 0) { throw new ArgumentOutOfRangeException(nameof(interval)); } var query = HttpUtility.ParseQueryString(string.Empty); query["pair"] = pair; query["interval"] = interval.ToString(); query["start_time"] = startTime.ToString(); query["end_time"] = endTime.ToString(); string queryString = query.ToString().Insert(0, "?"); var result = await ExecuteCall(Utils.ComposeUrl(getCandleSticks, queryString)); return(CandleStick.FromJson(result)); }
/// <summary> /// Returns 24-hour data for all pairs and markets. /// </summary> /// <returns></returns> public async Task <List <CandleStick> > Get24HourDataAsync() { var result = await ExecuteCall(get24HourData); return(CandleStick.FromJson(result)); }